Add rayman2 source files
This commit is contained in:
149
Rayman_X/cpa/tempgrp/ISI/ISI.DSP
Normal file
149
Rayman_X/cpa/tempgrp/ISI/ISI.DSP
Normal file
@@ -0,0 +1,149 @@
|
||||
# Microsoft Developer Studio Project File - Name="ISI" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=ISI - 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 "Isi.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 "Isi.mak" CFG="ISI - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ISI - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ISI - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "ISI - Win32 Retail" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""$/cpa/tempgrp/ISI", WJDAAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "ISI - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x:\cpa\lib"
|
||||
# PROP Intermediate_Dir "Tmp\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /W3 /GX /O2 /I "X:\CPA\Public" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\Lib\ISIP5_vr.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ISI - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "X:\CPA\Lib"
|
||||
# PROP Intermediate_Dir "Tmp\Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /G5 /W3 /GX /Z7 /Od /I "X:\CPA\Public" /D "_DEBUG" /D "VISUAL" /D "WIN32" /D "USE_PROFILER" /D "MTH_CHECK" /D "CPA_WANTS_EXPORT" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\Lib\ISIP5_vd.lib"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ISI - Win32 Retail"
|
||||
|
||||
# PROP BASE Use_MFC 2
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ISI___Wi"
|
||||
# PROP BASE Intermediate_Dir "ISI___Wi"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "x:/cpa/lib"
|
||||
# PROP Intermediate_Dir "tmp/retail"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /G5 /MD /W3 /GX /O2 /I "X:\CPA\Public" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "CPA_WANTS_EXPORT" /FD /c
|
||||
# SUBTRACT BASE CPP /Fr /YX
|
||||
# ADD CPP /nologo /G5 /W3 /GX /O2 /I "X:\CPA\Public" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "RETAIL" /FD /c
|
||||
# SUBTRACT CPP /Fr /YX
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo /out:"X:\CPA\Lib\ISIP5_vr.lib"
|
||||
# ADD LIB32 /nologo /out:"X:\CPA\Lib\ISIP5_vf.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ISI - Win32 Release"
|
||||
# Name "ISI - Win32 Debug"
|
||||
# Name "ISI - Win32 Retail"
|
||||
# Begin Group "Src"
|
||||
|
||||
# PROP Default_Filter "*.c"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ISI.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Specif\ISI_Func.cxx
|
||||
|
||||
!IF "$(CFG)" == "ISI - Win32 Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ISI - Win32 Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ISI - Win32 Retail"
|
||||
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Inc"
|
||||
|
||||
# PROP Default_Filter "*.h"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\public\ISI\ISI_Ext.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\public\ISI\Specif\ISI_Func.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Isi.mak
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
501
Rayman_X/cpa/tempgrp/ISI/ISI.c
Normal file
501
Rayman_X/cpa/tempgrp/ISI/ISI.c
Normal file
@@ -0,0 +1,501 @@
|
||||
/* ##C_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : ISI_ISI.c
|
||||
|
||||
DESCRIPTION : ISI accessors, loading, saving, creating, deleting.
|
||||
|
||||
VERSION : 1.00 / David Fournier
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* ##INCLUDE#----------------------------------------------------------------------------
|
||||
Includes Files
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*For game material*/
|
||||
#include "GMT/GmtHandl.h"
|
||||
|
||||
#include "ACP_base.h"
|
||||
/*memory management of geometry.*/
|
||||
#include "GEO.h"
|
||||
|
||||
#include "GLI.h"
|
||||
|
||||
#include "SCR.h"
|
||||
#include "COL.h"
|
||||
#include "SPO.h"
|
||||
|
||||
/*IPO*/
|
||||
#include "PCS.h"
|
||||
#include "PO.h"
|
||||
#include "IPO.h"
|
||||
|
||||
/*PATH NAME*/
|
||||
#include "DPT.h"
|
||||
|
||||
#if !defined(U64)
|
||||
/*#include "BIN.h"*/
|
||||
#endif /* U64 */
|
||||
|
||||
#include "ISI\ISI_Ext.h"
|
||||
#include "ISI\Specif\ISI_Func.h"
|
||||
#include "ISI_Int.h"
|
||||
|
||||
/* ##CONSTANTE#--------------------------------------------------------------------------
|
||||
Constantes declaration
|
||||
---------------------------------------------------------------------------------------*/
|
||||
#ifndef _FIRE_DEADCODE_U64_
|
||||
#define ISI_C_BUFFER_SIZE 128*1024 /* Max size of a RLI ?*/
|
||||
#endif /* _FIRE_DEADCODE_U64_ */
|
||||
|
||||
|
||||
/* ##GLOBVAR#----------------------------------------------------------------------------
|
||||
Globale variable declaration
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
#if !defined(U64)
|
||||
/*Link Table*/
|
||||
SCR_tdst_Link_Table ISI_stLinkTable;
|
||||
#endif /* U64 */
|
||||
|
||||
/* ##FUNCDEF#----------------------------------------------------------------------------
|
||||
Functions definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
#if !defined(U64)
|
||||
SCR_tde_Anl_ReturnValue ISI_fn_xLoadISI(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType);
|
||||
#endif /* U64 */
|
||||
/*End of Prototypes*/
|
||||
|
||||
|
||||
#include "Specif\ISI_Func.cxx"
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Creating / Deleting
|
||||
############################## */
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_vInitLoad
|
||||
DESCRIPTION : Function to initialise the script loading
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_vInitLoad(void)
|
||||
{
|
||||
#if !defined(U64)
|
||||
SCR_fn_v_RdL0_RegisterCallback("ISI", ISI_fn_xLoadISI, SCR_CRC_c_RdL0_ForSection);
|
||||
SCR_fn_v_RdL0_RegisterCallback("IS2", ISI_fn_xLoadISI2, SCR_CRC_c_RdL0_ForSection);
|
||||
SCR_fn_v_Link_InitTable(&ISI_stLinkTable);
|
||||
#endif /* U64 */
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_hCreateISILOD
|
||||
DESCRIPTION : Create an ISI level of detail.
|
||||
INPUT : _hISI = Handle to ISI.
|
||||
_xNumISILOD = Level of detail number.
|
||||
_xNbRLI = Number of RLI.
|
||||
OUTPUT : Return table of RLI.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ISI_tdstColor *ISI_fn_hCreateISILOD(ACP_tdxHandleToRadiosity _hISI
|
||||
,ACP_tdxIndex _xNumISILOD,ACP_tdxIndex _xNbRLI)
|
||||
{
|
||||
ACP_tdxIndex xI;
|
||||
ISI_tdstColor *p_stTabCol;
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
hCpyISI->d_stISILOD[_xNumISILOD].xNbVertexRLI=_xNbRLI;
|
||||
MMG_fn_vAddMemoryInfo( MMG_C_lTypeISI , MMG_C_lSubTypeLOD , 0 );
|
||||
GEO_M_CPAMalloc(p_stTabCol,ISI_tdstColor *, sizeof(ISI_tdstColor)*_xNbRLI, E_uwGEONotEnoughtMemory);
|
||||
hCpyISI->d_stISILOD[_xNumISILOD].d_stVertexRLI=p_stTabCol;
|
||||
for(xI=0;xI<_xNbRLI;xI++)
|
||||
{
|
||||
p_stTabCol[xI].xRed=0;
|
||||
p_stTabCol[xI].xGreen=0;
|
||||
p_stTabCol[xI].xBlue=0;
|
||||
p_stTabCol[xI].xAlpha=0;
|
||||
}
|
||||
|
||||
return p_stTabCol;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_hCreateISI
|
||||
DESCRIPTION : Create ISI structure.
|
||||
INPUT : _xNbISILOD = Number of level of detail.
|
||||
OUTPUT : handle to ISI.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ACP_tdxHandleToRadiosity ISI_fn_hCreateISI(ACP_tdxIndex _xNbISILOD)
|
||||
{
|
||||
ISI_HandleToISI hISI;
|
||||
ACP_tdxIndex xI;
|
||||
|
||||
MMG_fn_vAddMemoryInfo( MMG_C_lTypeISI , MMG_C_lSubTypeStruct , 0 );
|
||||
GEO_M_CPAMalloc(hISI,ISI_HandleToISI,sizeof(struct ISI_tdstISI_),E_uwGEONotEnoughtMemory);
|
||||
hISI->xNbISILOD=_xNbISILOD;
|
||||
|
||||
MMG_fn_vAddMemoryInfo( MMG_C_lTypeISI , MMG_C_lSubTypeArray , 0 );
|
||||
GEO_M_CPAMalloc(hISI->d_stISILOD,ISI_tdstISILOD *, sizeof(ISI_tdstISILOD)*_xNbISILOD, E_uwGEONotEnoughtMemory);
|
||||
for(xI=0;xI<_xNbISILOD;xI++)
|
||||
{
|
||||
hISI->d_stISILOD[xI].xNbVertexRLI=0;
|
||||
hISI->d_stISILOD[xI].d_stVertexRLI=NULL;
|
||||
}
|
||||
|
||||
return (ACP_tdxHandleToRadiosity)hISI;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vFreeISI
|
||||
DESCRIPTION : Free an ISI structure.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
#ifndef _FIRE_DEADCODE_U64_
|
||||
void ISI_fn_vFreeISI(ACP_tdxHandleToRadiosity _hISI)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
ACP_tdxIndex xI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
for(xI=0;xI<hCpyISI->xNbISILOD;xI++)
|
||||
{
|
||||
if (hCpyISI->d_stISILOD[xI].d_stVertexRLI)
|
||||
GEO_M_CPAFree(hCpyISI->d_stISILOD[xI].d_stVertexRLI);
|
||||
}
|
||||
GEO_M_CPAFree(hCpyISI->d_stISILOD);
|
||||
GEO_M_CPAFree(hCpyISI);
|
||||
}
|
||||
#endif /* _FIRE_DEADCODE_U64_ */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Accessors
|
||||
############################## */
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_ColISIToGEO
|
||||
DESCRIPTION : Convert a ISI_tdstColor in GEO_tdstColor.
|
||||
INPUT : GEOCol = table of GEO color.
|
||||
ISICol = table of ISI color.
|
||||
ulNbr = number of color.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
#define ISI_xColorCompInvFac 0.00390625f /* 1/ISI_tdxColorCompFac = 1/256*/
|
||||
|
||||
void ISI_ColISIToGEO(GEO_tdstColor *GEOCol ,ISI_tdstColor *ISICol,unsigned long ulNbr)
|
||||
{
|
||||
|
||||
float *p_fGeo, *p_fLastGeo;
|
||||
ISI_tdxColorComp *p_xIsi;
|
||||
|
||||
p_fGeo = (float *) GEOCol;
|
||||
p_fLastGeo = (float *) (GEOCol + ulNbr);
|
||||
p_xIsi = (ISI_tdxColorComp *) ISICol;
|
||||
|
||||
for (; p_fGeo < p_fLastGeo;)
|
||||
{
|
||||
*p_fGeo++ = *p_xIsi++ * ISI_xColorCompInvFac;
|
||||
*p_fGeo++ = *p_xIsi++ * ISI_xColorCompInvFac;
|
||||
*p_fGeo++ = *p_xIsi++ * ISI_xColorCompInvFac;
|
||||
*p_fGeo++ = *p_xIsi++ * ISI_xColorCompInvFac;
|
||||
}
|
||||
|
||||
/*
|
||||
while (ulNbr--)
|
||||
{
|
||||
GEOCol->xR = MTH_M_xLongToFloat((long)ISICol->xRed) * ISI_xColorCompInvFac;
|
||||
GEOCol->xG = MTH_M_xLongToFloat((long)ISICol->xGreen) * ISI_xColorCompInvFac;
|
||||
GEOCol->xB = MTH_M_xLongToFloat((long)ISICol->xBlue) * ISI_xColorCompInvFac;
|
||||
GEOCol->xA = MTH_M_xLongToFloat((long)ISICol->xAlpha) * ISI_xColorCompInvFac;
|
||||
GEOCol++;
|
||||
ISICol++;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_ColGEOToISI
|
||||
DESCRIPTION : Convert a GEO_tdstColor in ISI_tdstColor.
|
||||
INPUT : ISICol = table of ISI color.
|
||||
GEOCol = table of GEO color.
|
||||
ulNbr = number of color.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_ColGEOToISI(ISI_tdstColor *ISICol , GEO_tdstColor *GEOCol,unsigned long ulNbr)
|
||||
{
|
||||
long R,G,B,A;
|
||||
while (ulNbr--)
|
||||
{
|
||||
R=MTH_M_xFloatToLong(GEOCol->xR*ISI_tdxColorCompFac);
|
||||
G=MTH_M_xFloatToLong(GEOCol->xG*ISI_tdxColorCompFac);
|
||||
B=MTH_M_xFloatToLong(GEOCol->xB*ISI_tdxColorCompFac);
|
||||
A=MTH_M_xFloatToLong(GEOCol->xA*ISI_tdxColorCompFac);
|
||||
if (R<ISI_tdxColorCompMin) R=ISI_tdxColorCompMin;
|
||||
else if (R>ISI_tdxColorCompMax) R=ISI_tdxColorCompMax;
|
||||
if (G<ISI_tdxColorCompMin) G=ISI_tdxColorCompMin;
|
||||
else if (G>ISI_tdxColorCompMax) G=ISI_tdxColorCompMax;
|
||||
if (B<ISI_tdxColorCompMin) B=ISI_tdxColorCompMin;
|
||||
else if (B>ISI_tdxColorCompMax) B=ISI_tdxColorCompMax;
|
||||
if (A<ISI_tdxColorCompMin) A=ISI_tdxColorCompMin;
|
||||
else if (A>ISI_tdxColorCompMax) A=ISI_tdxColorCompMax;
|
||||
ISICol->xRed =(ISI_tdxColorComp)R;
|
||||
ISICol->xGreen=(ISI_tdxColorComp)G;
|
||||
ISICol->xBlue =(ISI_tdxColorComp)B;
|
||||
ISICol->xAlpha=(ISI_tdxColorComp)A;
|
||||
GEOCol++;
|
||||
ISICol++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_xGetNbLOD
|
||||
DESCRIPTION : Return the number of LOD.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
OUTPUT : Number of LOD.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ACP_tdxIndex ISI_fn_xGetNbLOD(ACP_tdxHandleToRadiosity _hISI)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
return hCpyISI->xNbISILOD;
|
||||
}
|
||||
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_xGetNbVertexRLILOD
|
||||
DESCRIPTION : Return the number of RLI for one LOD.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
_xNumISILOD = LOD number.
|
||||
OUTPUT : Number of RLI in the LOD.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ACP_tdxIndex ISI_fn_xGetNbVertexRLILOD(ACP_tdxHandleToRadiosity _hISI,ACP_tdxIndex _xNumISILOD)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
return hCpyISI->d_stISILOD[_xNumISILOD].xNbVertexRLI;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_dGetVertexRLILOD
|
||||
DESCRIPTION : Return the table of RLI for one LOD.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
_xNumISILOD = LOD number.
|
||||
OUTPUT : Table of RLI.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ISI_tdstColor *ISI_fn_dGetVertexRLILOD(ACP_tdxHandleToRadiosity _hISI,ACP_tdxIndex _xNumISILOD)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
return hCpyISI->d_stISILOD[_xNumISILOD].d_stVertexRLI;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_xGetNbVertexRLI
|
||||
DESCRIPTION : Return the number of RLI for the first LOD.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
OUTPUT : Number of RLI for the first LOD.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ACP_tdxIndex ISI_fn_xGetNbVertexRLI(ACP_tdxHandleToRadiosity _hISI)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
return hCpyISI->d_stISILOD[0].xNbVertexRLI;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_dGetVertexRLI
|
||||
DESCRIPTION : Return the table of RLI for the first LOD.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
OUTPUT : Table of RLI for the first LOD.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
ISI_tdstColor *ISI_fn_dGetVertexRLI(ACP_tdxHandleToRadiosity _hISI)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
return hCpyISI->d_stISILOD[0].d_stVertexRLI;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vSetVertexRLILOD
|
||||
DESCRIPTION : Change RLI of one vertex for one LOD.
|
||||
INPUT : _hISI = handle to ISI.
|
||||
_p_stColor = adress of ISI color for setting.
|
||||
_xNumISILOD = LOD number in the ISI.
|
||||
_xIndex = RLI number in the LOD.
|
||||
OUTPUT : Table of RLI for the first LOD.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_fn_vSetVertexRLILOD(ACP_tdxHandleToRadiosity _hISI, ISI_tdstColor *_p_stColor,
|
||||
ACP_tdxIndex _xNumISILOD, ACP_tdxIndex _xIndex)
|
||||
{
|
||||
ISI_HandleToISI hCpyISI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_hISI;
|
||||
|
||||
hCpyISI->d_stISILOD[_xNumISILOD].d_stVertexRLI[_xIndex]=*_p_stColor;
|
||||
}
|
||||
|
||||
#endif /* _FIRE_DEADCODE_U64_ */
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vAmbientLight
|
||||
DESCRIPTION : Add ambient light to all RLI, create RLI if they not exist.
|
||||
INPUT : _hSuperObject = hierarchie for lighting.
|
||||
_xDR = red intensity.
|
||||
_xDG = green intensity.
|
||||
_xDB = blue intensity.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_fn_vAmbientLight(HIE_tdxHandleToSuperObject _hSuperObject,
|
||||
MTH_tdxReal _xDR,
|
||||
MTH_tdxReal _xDG,
|
||||
MTH_tdxReal _xDB)
|
||||
{
|
||||
HIE_tdxHandleToSuperObject hchildSO;
|
||||
ACP_tdxHandleOfObject hPhysicalObject;
|
||||
ACP_tdxIndex xI,xNumISILOD,xNbVertexRLI;
|
||||
ACP_tdxHandleToRadiosity hISI;
|
||||
ISI_HandleToISI hCpyISI;
|
||||
GEO_tdstColor GEOColInt;
|
||||
ISI_tdstColor *d_stVertexRLI;
|
||||
MTH_tdxReal xTemp;
|
||||
long lType;
|
||||
|
||||
HIE_M_ForEachChildOf(_hSuperObject,hchildSO,xI)
|
||||
{
|
||||
ISI_fn_vAmbientLight(hchildSO,_xDR,_xDG,_xDB);
|
||||
}
|
||||
|
||||
lType = HIE_fn_ulGetSuperObjectType(_hSuperObject);
|
||||
if(lType & ( HIE_C_ulIPO | HIE_C_ulIPO_Mirror))
|
||||
{
|
||||
hISI=IPO_fn_hGetRadiosity((IPO_tdxHandleToInstanciatedPhysicalObject)HIE_fn_hGetSuperObjectObject(_hSuperObject));
|
||||
|
||||
if(!hISI)
|
||||
{
|
||||
GEO_tdxHandleToVisualSet hVisuSet;
|
||||
ACP_tdxIndex xNbLod;
|
||||
|
||||
hVisuSet=PO_fn_hGetVisualSet(IPO_fn_hGetPhysicalObject((IPO_tdxHandleToInstanciatedPhysicalObject)HIE_fn_hGetSuperObjectObject(_hSuperObject)));
|
||||
xNbLod=(short)GLI_lGetVisualSetNumbertOfLOD(hVisuSet);
|
||||
if (xNbLod>2) xNbLod=2;
|
||||
hISI=ISI_fn_hCreateISI(xNbLod);
|
||||
IPO_fn_vSetRadiosity((IPO_tdxHandleToInstanciatedPhysicalObject)HIE_fn_hGetSuperObjectObject(_hSuperObject),hISI);
|
||||
|
||||
for(xNumISILOD=0;xNumISILOD<xNbLod;xNumISILOD++)
|
||||
{
|
||||
GLI_vGetVisualSetLOD(hVisuSet,xNumISILOD,&xTemp,&hPhysicalObject);
|
||||
ISI_fn_hCreateISILOD(hISI,xNumISILOD,hPhysicalObject->xNbPoints);
|
||||
}
|
||||
}
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)hISI;
|
||||
|
||||
/* For all LOD.*/
|
||||
for(xNumISILOD=0;xNumISILOD<hCpyISI->xNbISILOD;xNumISILOD++)
|
||||
{
|
||||
xNbVertexRLI=hCpyISI->d_stISILOD[xNumISILOD].xNbVertexRLI;
|
||||
d_stVertexRLI=hCpyISI->d_stISILOD[xNumISILOD].d_stVertexRLI;
|
||||
/* For all RLI of the LOD.*/
|
||||
for(xI=0;xI<xNbVertexRLI;xI++)
|
||||
{
|
||||
ISI_ColISIToGEO(&GEOColInt , d_stVertexRLI+xI,1);
|
||||
GEOColInt.xR+=MTH_M_xRealToFloat(_xDR);
|
||||
GEOColInt.xG+=MTH_M_xRealToFloat(_xDG);
|
||||
GEOColInt.xB+=MTH_M_xRealToFloat(_xDB);
|
||||
ISI_ColGEOToISI(d_stVertexRLI+xI , &GEOColInt,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_hComputeBlendRLI
|
||||
DESCRIPTION : compute a blend between two ISI.
|
||||
INPUT : hRLI1 = first table
|
||||
hRLI2 = second table
|
||||
xNumISILOD = number of the affected LOD
|
||||
xPercent = percentage of the second table in the result (i.e : there is 1-xPercent
|
||||
of the first table in the result)
|
||||
OUTPUT: handle of ISI
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 17/02/98 Jean-Marc Drouaud
|
||||
=======================================================================================*/
|
||||
ACP_tdxHandleToRadiosity ISI_hComputeBlendRLI ( ACP_tdxHandleToRadiosity hRLI1,
|
||||
ACP_tdxHandleToRadiosity hRLI2,
|
||||
ACP_tdxIndex xNumISILOD,
|
||||
MTH_tdxReal xPercent ) {
|
||||
ACP_tdxHandleToRadiosity hReturnRad = NULL ;
|
||||
ISI_HandleToISI hBlendISI, hISI1, hISI2 ;
|
||||
ACP_tdxIndex xI, xNbVertex ;
|
||||
ISI_tdstColor *p_stBlendTabCol, *p_stTabCol1, *p_stTabCol2;
|
||||
MTH_tdxReal xPercentComplement ;
|
||||
|
||||
hISI1 = (ISI_HandleToISI)hRLI1 ;
|
||||
hISI2 = (ISI_HandleToISI)hRLI2 ;
|
||||
|
||||
hBlendISI = ISI_fn_hCreateISI (hISI1->xNbISILOD) ;
|
||||
hReturnRad = (ISI_HandleToISI)hBlendISI ;
|
||||
|
||||
xNbVertex = hISI1->d_stISILOD[xNumISILOD].xNbVertexRLI ;
|
||||
|
||||
hBlendISI->d_stISILOD[xNumISILOD].xNbVertexRLI = xNbVertex ;
|
||||
MMG_fn_vAddMemoryInfo( MMG_C_lTypeISI , MMG_C_lSubTypeBlendRLI , 0 );
|
||||
GEO_M_CPAMalloc( p_stBlendTabCol, ISI_tdstColor *,
|
||||
sizeof(ISI_tdstColor) * xNbVertex,
|
||||
E_uwGEONotEnoughtMemory);
|
||||
hBlendISI->d_stISILOD[xNumISILOD].d_stVertexRLI=p_stBlendTabCol;
|
||||
|
||||
|
||||
p_stTabCol1 = hISI1->d_stISILOD[xNumISILOD].d_stVertexRLI ;
|
||||
p_stTabCol2 = hISI2->d_stISILOD[xNumISILOD].d_stVertexRLI ;
|
||||
|
||||
xPercentComplement = (float)1.0 - xPercent ;
|
||||
for(xI=0;xI<xNbVertex;xI++)
|
||||
{
|
||||
p_stBlendTabCol[xI].xRed = (short)(p_stTabCol1[xI].xRed*xPercentComplement + p_stTabCol2[xI].xRed*xPercent) ;
|
||||
p_stBlendTabCol[xI].xGreen= (short)(p_stTabCol1[xI].xGreen*xPercentComplement + p_stTabCol2[xI].xGreen*xPercent) ;
|
||||
p_stBlendTabCol[xI].xBlue = (short)(p_stTabCol1[xI].xBlue*xPercentComplement + p_stTabCol2[xI].xBlue*xPercent) ;
|
||||
p_stBlendTabCol[xI].xAlpha= (short)(p_stTabCol1[xI].xAlpha*xPercentComplement+ p_stTabCol2[xI].xAlpha*xPercent) ;
|
||||
}
|
||||
return (hReturnRad) ;
|
||||
}
|
||||
/*END ANNECY JMD }*/
|
||||
|
245
Rayman_X/cpa/tempgrp/ISI/ISI.vcproj
Normal file
245
Rayman_X/cpa/tempgrp/ISI/ISI.vcproj
Normal file
@@ -0,0 +1,245 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="ISI"
|
||||
ProjectGUID="{3962193E-961E-4B21-9572-0577EE230926}"
|
||||
SccProjectName=""$/cpa/tempgrp/ISI", WJDAAAAA"
|
||||
SccAuxPath=""
|
||||
SccLocalPath="."
|
||||
SccProvider="MSSCCI:NXN alienbrain">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Retail|Win32"
|
||||
OutputDirectory="x:/cpa/lib"
|
||||
IntermediateDirectory=".\tmp/retail"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="X:\CPA\Public"
|
||||
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;RETAIL"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
PrecompiledHeaderFile=".\tmp/retail/ISI.pch"
|
||||
AssemblerListingLocation=".\tmp/retail/"
|
||||
ObjectFile=".\tmp/retail/"
|
||||
ProgramDataBaseFileName=".\tmp/retail/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\Lib\ISIP5_vf.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="x:\cpa\lib"
|
||||
IntermediateDirectory=".\Tmp\Release"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="X:\CPA\Public"
|
||||
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;USE_PROFILER"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
PrecompiledHeaderFile=".\Tmp\Release/ISI.pch"
|
||||
AssemblerListingLocation=".\Tmp\Release/"
|
||||
ObjectFile=".\Tmp\Release/"
|
||||
ProgramDataBaseFileName=".\Tmp\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\Lib\ISIP5_vr.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="X:\CPA\Libd"
|
||||
IntermediateDirectory=".\Tmp\Debug"
|
||||
ConfigurationType="4"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
OptimizeForProcessor="1"
|
||||
AdditionalIncludeDirectories="X:\CPA\Public"
|
||||
PreprocessorDefinitions="_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT"
|
||||
RuntimeLibrary="3"
|
||||
PrecompiledHeaderFile=".\Tmp\Debug/ISI.pch"
|
||||
AssemblerListingLocation=".\Tmp\Debug/"
|
||||
ObjectFile=".\Tmp\Debug/"
|
||||
ProgramDataBaseFileName=".\Tmp\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="1"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="X:\CPA\Libd\ISIP5_vd.lib"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Src"
|
||||
Filter="*.c">
|
||||
<File
|
||||
RelativePath="ISI.c">
|
||||
<FileConfiguration
|
||||
Name="Retail|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Specif\ISI_Func.cxx">
|
||||
<FileConfiguration
|
||||
Name="Retail|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Inc"
|
||||
Filter="*.h">
|
||||
<File
|
||||
RelativePath="..\..\public\ISI\ISI_Ext.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\ISI\Specif\ISI_Func.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="Isi.mak">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
47
Rayman_X/cpa/tempgrp/ISI/ISI_Int.h
Normal file
47
Rayman_X/cpa/tempgrp/ISI/ISI_Int.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/*ISI_Int.h*/
|
||||
|
||||
#ifndef __ISI_INT
|
||||
#define __ISI_INT
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* For DLL using these function :*/
|
||||
#undef 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
|
||||
|
||||
/*End of declaration of structure*/
|
||||
|
||||
/*Declaration of structure*/
|
||||
typedef struct ISI_tdstISILOD_
|
||||
{
|
||||
ACP_tdxIndex xNbVertexRLI;
|
||||
ISI_tdstColor * d_stVertexRLI;
|
||||
}ISI_tdstISILOD;
|
||||
/*End of declaration of structure*/
|
||||
|
||||
/*Declaration of structure*/
|
||||
typedef struct ISI_tdstISI_
|
||||
{
|
||||
ACP_tdxIndex xNbISILOD;
|
||||
ISI_tdstISILOD * d_stISILOD;
|
||||
}ISI_tdstISI;
|
||||
/*End of declaration of structure*/
|
||||
|
||||
|
||||
/*Declaration of handle*/
|
||||
typedef struct ISI_tdstISI_* ISI_HandleToISI;
|
||||
/*End of declaration of handle*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /*__ISI_INT*/
|
462
Rayman_X/cpa/tempgrp/ISI/Specif/ISI_Func.cxx
Normal file
462
Rayman_X/cpa/tempgrp/ISI/Specif/ISI_Func.cxx
Normal file
@@ -0,0 +1,462 @@
|
||||
/* ISI_Func.c*/
|
||||
|
||||
/* ##-###########################
|
||||
## Saving / Loading
|
||||
############################## */
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_pGetLinkTable
|
||||
DESCRIPTION : Function to get the link table.
|
||||
OUTPUT : Link table.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
SCR_tdst_Link_Table *ISI_fn_pGetLinkTable(void)
|
||||
{
|
||||
return &ISI_stLinkTable;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vDisinitLinkTable
|
||||
DESCRIPTION : Function to disinit the link table.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_fn_vDisinitLinkTable(void)
|
||||
{
|
||||
SCR_fn_v_Link_CloseTable(&ISI_stLinkTable);
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_xLoadISI
|
||||
DESCRIPTION : Load the ISI of an IPO. (Script callback)
|
||||
INPUT : p_fFile = script file description.
|
||||
szAction = action name.
|
||||
szParams = table of param.
|
||||
cType = type of action.
|
||||
OUTPUT : script error code.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
SCR_tde_Anl_ReturnValue ISI_fn_xLoadISI(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||
{
|
||||
ACP_tdxHandleToRadiosity hISI;
|
||||
ACP_tdxIndex xIndex;
|
||||
char a255_cTempName[255];
|
||||
static ISI_tdstColor *d_stVertexRLI;
|
||||
|
||||
switch (cType)
|
||||
{
|
||||
case SCR_EA_Anl_BeginSection:
|
||||
|
||||
if (SCR_fn_uc_RdL0_GetNumberOfParameters(szParams)==2)
|
||||
{
|
||||
/*New ISI*/
|
||||
hISI=ISI_fn_hCreateISI((ACP_tdxIndex)(atol(szParams[1])));
|
||||
}
|
||||
else
|
||||
{
|
||||
hISI=ISI_fn_hCreateISI(1);
|
||||
d_stVertexRLI=ISI_fn_hCreateISILOD(hISI,0,(ACP_tdxIndex)atol(szParams[0]));
|
||||
}
|
||||
|
||||
SCR_M_RdL0_SetSectionLong(0,0,(long)hISI);
|
||||
SCR_M_RdL0_SetContextLong(0,0,(long)hISI);
|
||||
|
||||
/*Get Path*/
|
||||
strcpy(a255_cTempName,fn_szGetLevelsDataPath());
|
||||
strcat(a255_cTempName,"\\");
|
||||
strcat(a255_cTempName,SCR_M_RdL0_GetCompleteSectionNameR(0));
|
||||
|
||||
SCR_fnp_st_Link_SetValue(
|
||||
&ISI_stLinkTable,
|
||||
a255_cTempName,
|
||||
(unsigned long)hISI
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
case SCR_EA_Anl_Entry:
|
||||
SCR_M_RdL0_GetContextLong(0,0,void *, hISI);
|
||||
|
||||
/* New LOD*/
|
||||
if (strcmp(szAction,"AddLODRLI")==0)
|
||||
{
|
||||
d_stVertexRLI=ISI_fn_hCreateISILOD(hISI,(ACP_tdxIndex)atoi(szParams[0]),(ACP_tdxIndex)atoi(szParams[1]));
|
||||
}
|
||||
|
||||
/* Loading of object's vertex*/
|
||||
if (strcmp(szAction,"AddVertexRLILOD")==0)
|
||||
{
|
||||
xIndex = (ACP_tdxIndex)atoi(szParams[0]);
|
||||
|
||||
d_stVertexRLI[xIndex].xRed=(ISI_tdxColorComp)(atoi(szParams[1]));
|
||||
d_stVertexRLI[xIndex].xGreen=(ISI_tdxColorComp)(atoi(szParams[2]));
|
||||
d_stVertexRLI[xIndex].xBlue=(ISI_tdxColorComp)(atoi(szParams[3]));
|
||||
if(SCR_fn_uc_RdL0_GetNumberOfParameters(szParams) == 5)
|
||||
d_stVertexRLI[xIndex].xAlpha=(ISI_tdxColorComp)(atoi(szParams[4]));
|
||||
}
|
||||
/* Loading of object's vertex*/
|
||||
if (strcmp(szAction,"AddVertexRLI")==0)
|
||||
{
|
||||
xIndex = (ACP_tdxIndex)atoi(szParams[0]);
|
||||
|
||||
d_stVertexRLI[xIndex].xRed=(ISI_tdxColorComp)(atof(szParams[1]) * 255.f);
|
||||
d_stVertexRLI[xIndex].xGreen=(ISI_tdxColorComp)(atof(szParams[2]) * 255.f);
|
||||
d_stVertexRLI[xIndex].xBlue=(ISI_tdxColorComp)(atof(szParams[3]) * 255.f);
|
||||
if(SCR_fn_uc_RdL0_GetNumberOfParameters(szParams) == 5)
|
||||
d_stVertexRLI[xIndex].xAlpha=(ISI_tdxColorComp)(atof(szParams[4]) * 255.f);
|
||||
}
|
||||
case SCR_EA_Anl_EndSection:
|
||||
break;
|
||||
}
|
||||
return SCR_ERV_Anl_NormalReturn;
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_vSaveVertexISI
|
||||
DESCRIPTION : Save an ISI of an IPO. (Script callback)
|
||||
INPUT : _p_stFile = script file description.
|
||||
_sFileName = file name.
|
||||
_p_vPtr = struct adress.
|
||||
_xAction = type of action
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_vSaveVertexISI(SCR_tdst_File_Description *_p_stFile, char *_sFileName, void *_p_vPtr, SCR_tde_Ntfy_Action _xAction)
|
||||
{
|
||||
ACP_tdxIndex xI,xNumISILOD,xNbVertexRLI;
|
||||
ISI_HandleToISI hCpyISI;
|
||||
char sFile[255];
|
||||
char sSection[255];
|
||||
char sIdent[255];
|
||||
char sBeginSection[255];
|
||||
ISI_tdstColor *d_stVertexRLI;
|
||||
|
||||
hCpyISI=(ISI_HandleToISI)_p_vPtr;
|
||||
|
||||
if(_xAction == SCR_EA_Ntfy_AddSection)
|
||||
{
|
||||
SCR_fn_v_SvL1_ToEndSection(_p_stFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
SCR_fn_v_SvL1_DeleteSection(_p_stFile);
|
||||
}
|
||||
|
||||
SCR_fn_v_RdL0_SplitSectionName(_sFileName, sFile, sSection, sIdent);
|
||||
|
||||
sprintf(sBeginSection,"%s:%s", sSection, sIdent);
|
||||
|
||||
/*BeginSection*/
|
||||
SCR_M_SvL0_SaveBeginSection(_p_stFile, sBeginSection, SCR_CC_C_Cfg_NoChar);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile, SCR_EF_SvL0_Scanf, 2,"%s,%d", "NBRLOD",hCpyISI->xNbISILOD);
|
||||
|
||||
/* For all LOD.*/
|
||||
for(xNumISILOD=0;xNumISILOD<hCpyISI->xNbISILOD;xNumISILOD++)
|
||||
{
|
||||
xNbVertexRLI=hCpyISI->d_stISILOD[xNumISILOD].xNbVertexRLI;
|
||||
d_stVertexRLI=hCpyISI->d_stISILOD[xNumISILOD].d_stVertexRLI;
|
||||
SCR_M_SvL0_SaveEntry(_p_stFile, "AddLODRLI", SCR_CC_C_Cfg_NoChar);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile,SCR_EF_SvL0_Scanf,3,"%d,%d",xNumISILOD,xNbVertexRLI);
|
||||
/* For all RLI of the LOD.*/
|
||||
for(xI=0;xI<xNbVertexRLI;xI++)
|
||||
{
|
||||
SCR_M_SvL0_SaveEntry(_p_stFile, "AddVertexRLILOD", SCR_CC_C_Cfg_NoChar);
|
||||
SCR_fn_v_SvL0_SaveParameters_MP(_p_stFile,SCR_EF_SvL0_Scanf,6,"%d,%d,%d,%d,%d",
|
||||
xI,(int)d_stVertexRLI[xI].xRed,(int)d_stVertexRLI[xI].xGreen,(int)d_stVertexRLI[xI].xBlue,(int)d_stVertexRLI[xI].xAlpha);
|
||||
}
|
||||
}
|
||||
|
||||
/*Endsection*/
|
||||
SCR_M_SvL0_SaveEndSection(_p_stFile, SCR_CC_C_Cfg_EOL);
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_vSaveISIFromIPO
|
||||
DESCRIPTION : Save all ISI for one IPO.
|
||||
INPUT : _hIPO = IPO handle to save.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_vSaveISIFromIPO(IPO_tdxHandleToInstanciatedPhysicalObject _hIPO)
|
||||
{
|
||||
ACP_tdxHandleToRadiosity hISI;
|
||||
SCR_tdst_Link_Value *p_stSCRResearch;
|
||||
char sFile[255];
|
||||
char *p_cReplace;
|
||||
|
||||
hISI=IPO_fn_hGetRadiosity(_hIPO);
|
||||
|
||||
if(hISI)
|
||||
{
|
||||
p_stSCRResearch=SCR_fnp_st_Link_SearchValue(&ISI_stLinkTable,(unsigned long)hISI);
|
||||
|
||||
if(p_stSCRResearch)
|
||||
{
|
||||
strcpy(sFile,SCR_M_p_sz_Link_GetKey(p_stSCRResearch));
|
||||
}
|
||||
else
|
||||
{
|
||||
p_stSCRResearch=SCR_fnp_st_Link_SearchValue(&IPO_g_stLinkTable,(unsigned long)_hIPO);
|
||||
if(p_stSCRResearch)
|
||||
{
|
||||
strcpy(sFile,SCR_M_p_sz_Link_GetKey(p_stSCRResearch));
|
||||
|
||||
p_cReplace=strstr(sFile,"ipo");
|
||||
if(p_cReplace)
|
||||
{
|
||||
*p_cReplace='r';
|
||||
p_cReplace++;
|
||||
*p_cReplace='l';
|
||||
p_cReplace++;
|
||||
*p_cReplace='i';
|
||||
}
|
||||
|
||||
p_cReplace=strstr(sFile,"^IPO");
|
||||
if(p_cReplace) {
|
||||
char * p_cSubSection;
|
||||
|
||||
p_cSubSection = strstr(sFile,":IPO");
|
||||
if (p_cSubSection)
|
||||
sprintf(p_cReplace,"^ISI:ISI%s",p_cSubSection+4);
|
||||
}
|
||||
|
||||
/*while((p_cReplace=strstr(sFile,"IPO"))!=NULL)
|
||||
{
|
||||
*p_cReplace='I';
|
||||
p_cReplace++;
|
||||
*p_cReplace='S';
|
||||
p_cReplace++;
|
||||
*p_cReplace='I';
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(sFile,"Default.rli^ISI:ISI");
|
||||
}
|
||||
}
|
||||
SCR_fn_v_SvL1_RegisterNotify(sFile, ISI_vSaveVertexISI, (void *)hISI, SCR_EA_Ntfy_AddOrModifySection);
|
||||
|
||||
/* del by jt 9/6/97*/
|
||||
/* SCR_fn_v_SvL1_UpdateAllNotify();*/
|
||||
/* end jt 9/6/97*/
|
||||
}
|
||||
}
|
||||
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vSaveISIFromIPOFromHierarchie
|
||||
DESCRIPTION : Save all ISI for all IPO which are child of a super object,
|
||||
or which is the super object.
|
||||
INPUT : _hSuperObject = super object handle to save.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
void ISI_fn_vSaveISIFromIPOFromHierarchie(HIE_tdxHandleToSuperObject _hSuperObject)
|
||||
{
|
||||
HIE_tdxHandleToSuperObject hchildSO;
|
||||
ACP_tdxIndex xI;
|
||||
|
||||
HIE_M_ForEachChildOf(_hSuperObject,hchildSO,xI)
|
||||
{
|
||||
ISI_fn_vSaveISIFromIPOFromHierarchie(hchildSO);
|
||||
}
|
||||
|
||||
if( HIE_fn_ulGetSuperObjectType(_hSuperObject) & (HIE_C_ulIPO | HIE_C_ulIPO_Mirror ))
|
||||
{
|
||||
ISI_vSaveISIFromIPO((IPO_tdxHandleToInstanciatedPhysicalObject)HIE_fn_hGetSuperObjectObject(_hSuperObject));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Private allocation function */
|
||||
/*
|
||||
char* ISI_fn_p_cGenericAllocateFunction(unsigned long _ulSize)
|
||||
{
|
||||
char* p_cBuffer;
|
||||
GEO_M_CPAMalloc (p_cBuffer,char*,_ulSize,E_uwGEONotEnoughtMemory);
|
||||
return p_cBuffer;
|
||||
}
|
||||
*/
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vPrepareSaveBinaryBloc
|
||||
DESCRIPTION : function to prepare the binary save process.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
/*
|
||||
void ISI_fn_vPrepareSaveBinaryBloc()
|
||||
{
|
||||
BIN_fn_vCreateBinaryIds(&ISI_stLinkTable,BIN_C_ISIID);
|
||||
}
|
||||
*/
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_ulWriteBinaryBloc
|
||||
DESCRIPTION : Write a binary bloc for a ISI
|
||||
INPUT : _ulStructAddress = Address of the element.
|
||||
_p_cDestBuffer = Pointer to the buffer.
|
||||
OUTPUT : length of the data written.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
/*
|
||||
unsigned long ISI_fn_ulWriteBinaryBloc(unsigned long _ulStructAddress, char* _p_cDestBuffer)
|
||||
{
|
||||
ISI_HandleToISI hISI=(ISI_HandleToISI)_ulStructAddress;
|
||||
ISI_tdstColor *d_stVertexRLI;
|
||||
ACP_tdxIndex xNumISILOD,xNbVertexRLI;
|
||||
char* p_cBufferPointer=_p_cDestBuffer;
|
||||
|
||||
p_cBufferPointer=BIN_fn_p_cPutStruct(p_cBufferPointer,(char*)hISI,sizeof(hISI));
|
||||
p_cBufferPointer=BIN_fn_p_cPutStruct(p_cBufferPointer,(char*)hISI->d_stISILOD,sizeof(ISI_tdstISILOD)*hISI->xNbISILOD);
|
||||
|
||||
// For all LOD.
|
||||
for(xNumISILOD=0;xNumISILOD<hISI->xNbISILOD;xNumISILOD++)
|
||||
{
|
||||
xNbVertexRLI=hISI->d_stISILOD[xNumISILOD].xNbVertexRLI;
|
||||
d_stVertexRLI=hISI->d_stISILOD[xNumISILOD].d_stVertexRLI;
|
||||
p_cBufferPointer=BIN_fn_p_cPutStruct(p_cBufferPointer,(char*)d_stVertexRLI,sizeof(ISI_tdstColor)*xNbVertexRLI);
|
||||
}
|
||||
|
||||
return p_cBufferPointer-_p_cDestBuffer;
|
||||
}
|
||||
*/
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vWriteAllISIBinaryBlocs
|
||||
DESCRIPTION : Write all the binary blocs for the ISI
|
||||
INPUT : _szBinaryFileName = Name of the binary file.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
/*
|
||||
void ISI_fn_vWriteAllISIBinaryBlocs(char* _szBinaryFileName)
|
||||
{
|
||||
ISI_fn_vPrepareSaveBinaryBloc();
|
||||
BIN_fn_vPutBinaryDataIntoFileFromLinkTable( (char*)_szBinaryFileName,
|
||||
ISI_fn_pGetLinkTable(),
|
||||
ISI_C_BUFFER_SIZE,
|
||||
ISI_fn_ulWriteBinaryBloc);
|
||||
}
|
||||
*/
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_ulReadISIBinaryBloc
|
||||
DESCRIPTION : Read the binary bloc for ISI.
|
||||
INPUT : _p_cLoadedBuffer = pointer to the loaded buffer.
|
||||
_ulLoadedBufferSize = Size of the loaded buffer.
|
||||
OUTPUT : The pointer to the allocated element.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
/*
|
||||
void ISI_fn_ulReadISIBinaryBloc(unsigned long _ulLoadedBuffer)
|
||||
{
|
||||
ISI_HandleToISI hISI=(ISI_HandleToISI)_ulLoadedBuffer;
|
||||
ISI_tdstColor *d_stVertexRLI;
|
||||
ACP_tdxIndex xNumISILOD;
|
||||
|
||||
hISI->d_stISILOD=(ISI_tdstISILOD *)(hISI+1);
|
||||
d_stVertexRLI=(ISI_tdstColor *)(hISI->d_stISILOD+hISI->xNbISILOD);
|
||||
|
||||
// For all LOD.
|
||||
for(xNumISILOD=0;xNumISILOD<hISI->xNbISILOD;xNumISILOD++)
|
||||
{
|
||||
hISI->d_stISILOD[xNumISILOD].d_stVertexRLI=d_stVertexRLI;
|
||||
d_stVertexRLI+=hISI->d_stISILOD[xNumISILOD].xNbVertexRLI;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_vReadAllISIBinaryBlocs
|
||||
DESCRIPTION : Read all the binary blocs for the ISI.
|
||||
INPUT : _szBinaryFile = Name of the binary file.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 20/11/97 David Fournier : New commentary form.
|
||||
=======================================================================================*/
|
||||
/*
|
||||
void ISI_fn_vReadAllISIBinaryBlocs(char* _szBinaryFile)
|
||||
{
|
||||
BIN_fn_vReadDataFromLinkTableWithoutAllocation(ISI_fn_pGetLinkTable(),
|
||||
ISI_fn_ulReadISIBinaryBloc,
|
||||
ISI_C_BUFFER_SIZE,_szBinaryFile,
|
||||
ISI_fn_p_cGenericAllocateFunction);
|
||||
}
|
||||
*/
|
||||
/*ANNECY JMD 17/02/98{*/
|
||||
/* ##F===================================================================================
|
||||
NAME : ISI_fn_xLoadISI2
|
||||
DESCRIPTION : Load the ISI of an PO. (Script callback)
|
||||
INPUT : p_fFile = script file description.
|
||||
szAction = action name.
|
||||
szParams = table of param.
|
||||
cType = type of action.
|
||||
OUTPUT : script error code.
|
||||
=========================================================================================
|
||||
LAST MODIFICATIONS : 13/02/98 Jean-Marc Drouaud
|
||||
=======================================================================================*/
|
||||
SCR_tde_Anl_ReturnValue ISI_fn_xLoadISI2(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||
{
|
||||
ACP_tdxHandleToRadiosity hISI;
|
||||
ACP_tdxHandleToRadiosity *d_hRLI ;
|
||||
ACP_tdxIndex xIndex;
|
||||
static ISI_tdstColor *d_stVertexRLI;
|
||||
|
||||
switch (cType)
|
||||
{
|
||||
case SCR_EA_Anl_BeginSection:
|
||||
SCR_M_RdL0_GetContextLong(-1,0,ACP_tdxHandleToRadiosity *, d_hRLI);
|
||||
if (SCR_fn_uc_RdL0_GetNumberOfParameters(szParams)==2)
|
||||
{
|
||||
/*New ISI*/
|
||||
hISI=ISI_fn_hCreateISI((ACP_tdxIndex)atol(szParams[1]));
|
||||
}
|
||||
else
|
||||
{
|
||||
hISI=ISI_fn_hCreateISI(1);
|
||||
d_stVertexRLI=ISI_fn_hCreateISILOD(hISI,0,(ACP_tdxIndex)atol(szParams[0]));
|
||||
}
|
||||
*(d_hRLI++) = hISI ;
|
||||
SCR_M_RdL0_SetContextLong(-1,0,(long)d_hRLI);
|
||||
|
||||
SCR_M_RdL0_SetSectionLong(0,0,(long)hISI);
|
||||
SCR_M_RdL0_SetContextLong(0,0,(long)hISI);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case SCR_EA_Anl_Entry:
|
||||
SCR_M_RdL0_GetContextLong(0,0,void *, hISI);
|
||||
|
||||
/* New LOD*/
|
||||
if (strcmp(szAction,"AddLODRLI")==0)
|
||||
{
|
||||
d_stVertexRLI=ISI_fn_hCreateISILOD(hISI,(ACP_tdxIndex)atoi(szParams[0]),(ACP_tdxIndex)atoi(szParams[1]));
|
||||
}
|
||||
|
||||
/* Loading of object's vertex*/
|
||||
if (strcmp(szAction,"AddVertexRLILOD")==0)
|
||||
{
|
||||
xIndex = (ACP_tdxIndex)atoi(szParams[0]);
|
||||
|
||||
d_stVertexRLI[xIndex].xRed=(ISI_tdxColorComp)(atoi(szParams[1]));
|
||||
d_stVertexRLI[xIndex].xGreen=(ISI_tdxColorComp)(atoi(szParams[2]));
|
||||
d_stVertexRLI[xIndex].xBlue=(ISI_tdxColorComp)(atoi(szParams[3]));
|
||||
if(SCR_fn_uc_RdL0_GetNumberOfParameters(szParams) == 5)
|
||||
d_stVertexRLI[xIndex].xAlpha=(ISI_tdxColorComp)(atoi(szParams[4]));
|
||||
}
|
||||
/* Loading of object's vertex*/
|
||||
if (strcmp(szAction,"AddVertexRLI")==0)
|
||||
{
|
||||
xIndex = (ACP_tdxIndex)atoi(szParams[0]);
|
||||
|
||||
d_stVertexRLI[xIndex].xRed=(ISI_tdxColorComp)(atof(szParams[1]) * 255.f);
|
||||
d_stVertexRLI[xIndex].xGreen=(ISI_tdxColorComp)(atof(szParams[2]) * 255.f);
|
||||
d_stVertexRLI[xIndex].xBlue=(ISI_tdxColorComp)(atof(szParams[3]) * 255.f);
|
||||
if(SCR_fn_uc_RdL0_GetNumberOfParameters(szParams) == 5)
|
||||
d_stVertexRLI[xIndex].xAlpha=(ISI_tdxColorComp)(atof(szParams[4]) * 255.f);
|
||||
}
|
||||
case SCR_EA_Anl_EndSection:
|
||||
break;
|
||||
}
|
||||
return SCR_ERV_Anl_NormalReturn;
|
||||
}
|
||||
|
64
Rayman_X/cpa/tempgrp/ISI/Specif/isi_funcCB.cxx
Normal file
64
Rayman_X/cpa/tempgrp/ISI/Specif/isi_funcCB.cxx
Normal file
@@ -0,0 +1,64 @@
|
||||
/* MLT CC BEGIN 10/9/98 */
|
||||
|
||||
#include "ldt.h"
|
||||
|
||||
int ISI_LDT_LoadISI(LDT_tdst_Link * pLink)
|
||||
{
|
||||
ACP_tdxIndex xIndex;
|
||||
ISI_tdstColor *d_stVertexRLI;
|
||||
char a255_cTempName[255];
|
||||
ACP_tdxHandleToRadiosity hISI;
|
||||
LDT_tdeParseResult result=ParseResult_BeginSection;
|
||||
|
||||
if (LDT_iGetNbParams()==3)
|
||||
/*New ISI*/
|
||||
hISI=ISI_fn_hCreateISI(atol(LDT_szGetParam(2)));
|
||||
else
|
||||
{
|
||||
hISI=ISI_fn_hCreateISI(1);
|
||||
d_stVertexRLI=ISI_fn_hCreateISILOD(hISI,0,(ACP_tdxIndex)atol(LDT_szGetParam(1)));
|
||||
}
|
||||
|
||||
pLink->pObject = hISI;
|
||||
|
||||
LDT_ComputeSectionName( pLink, a255_cTempName);
|
||||
SCR_fnp_st_Link_SetValue( &ISI_stLinkTable, a255_cTempName, (unsigned long)hISI );
|
||||
|
||||
while( result!=ParseResult_EndSection )
|
||||
{
|
||||
result=LDT_GetNextEntry();
|
||||
switch( result )
|
||||
{
|
||||
case ParseResult_Entry: /* an entry */
|
||||
{
|
||||
char* szEntry=LDT_szGetEntryName();
|
||||
switch(*(long*)szEntry)
|
||||
{
|
||||
case 'LddA': /* "AddLODRLI" */
|
||||
d_stVertexRLI=ISI_fn_hCreateISILOD(hISI,(ACP_tdxIndex)atoi(LDT_szGetParam(1)),(ACP_tdxIndex)atoi(LDT_szGetParam(2)));
|
||||
break;
|
||||
default:
|
||||
xIndex = (ACP_tdxIndex)atoi(LDT_szGetParam(1));
|
||||
if(strlen(szEntry) > 12) /*"AddVertexRLILOD"*/
|
||||
{
|
||||
d_stVertexRLI[xIndex].xRed=(ISI_tdxColorComp)(atoi(LDT_szGetParam(2)));
|
||||
d_stVertexRLI[xIndex].xGreen=(ISI_tdxColorComp)(atoi(LDT_szGetParam(3)));
|
||||
d_stVertexRLI[xIndex].xBlue=(ISI_tdxColorComp)(atoi(LDT_szGetParam(4)));
|
||||
if(LDT_iGetNbParams() == 6)
|
||||
d_stVertexRLI[xIndex].xAlpha=(ISI_tdxColorComp)(atoi(LDT_szGetParam(5)));
|
||||
}
|
||||
else
|
||||
{
|
||||
d_stVertexRLI[xIndex].xRed=(ISI_tdxColorComp)(atof(LDT_szGetParam(2)) * 255.f);
|
||||
d_stVertexRLI[xIndex].xGreen=(ISI_tdxColorComp)(atof(LDT_szGetParam(3)) * 255.f);
|
||||
d_stVertexRLI[xIndex].xBlue=(ISI_tdxColorComp)(atof(LDT_szGetParam(4)) * 255.f);
|
||||
if(LDT_iGetNbParams() == 6)
|
||||
d_stVertexRLI[xIndex].xAlpha=(ISI_tdxColorComp)(atof(LDT_szGetParam(5)) * 255.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* MLT CC END 10/9/98 */
|
5
Rayman_X/cpa/tempgrp/ISI/mssccprj.scc
Normal file
5
Rayman_X/cpa/tempgrp/ISI/mssccprj.scc
Normal file
@@ -0,0 +1,5 @@
|
||||
SCC = This is a source code control file
|
||||
|
||||
[ISI.vcproj]
|
||||
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
|
||||
SCC_Project_Name = Perforce Project
|
Reference in New Issue
Block a user