reman3/Rayman_X/cpa/tempgrp/IPO/Specif/IPO.c

110 lines
5.0 KiB
C

/*=========================================================================
* IPO.c : Instanciated Physical Objects functions
*
* Version 1.0
* Creation date 25/04/97
* Revision date
*
* That file needs to be compatible for all platforms.
*
* (c) Ubi Studios 1997
*=======================================================================*/
#define IPO_FRIEND
#include "ACP_Base.h"
#include "GEO.h"
#include "GLI.h"
#include "SPO.h"
#include "PCS.h"
#include "PO.h"
#include "IPO.h"
/* ***************************************************************************** */
/* ********************** Basics functions for IPOs **************************** */
/* ***************************************************************************** */
/*-----------------------------------------------------------------------------
* Description : Allocate a Instanciated Physical Object
*-----------------------------------------------------------------------------
* Creation date : 28/04/97 Author : Sebastien DAVID
*-----------------------------------------------------------------------------*/
IPO_tdxHandleToInstanciatedPhysicalObject IPO_fn_hAllocInstanciatedPhysicalObject(void)
{
IPO_tdstInstanciatedPhysicalObject *p_stInstanciatedPhysicalObject;
/*p_stInstanciatedPhysicalObject = (struct IPO_tdstInstanciatedPhysicalObject_ *)Mmg_fn_p_vAlloc(sizeof(struct IPO_tdstInstanciatedPhysicalObject_));*/
MMG_fn_vAddMemoryInfo (MMG_C_lTypeIPO , MMG_C_lSubTypeIPOStructure , NULL);
GEO_M_CPAMalloc(p_stInstanciatedPhysicalObject,struct IPO_tdstInstanciatedPhysicalObject_ *, sizeof(struct IPO_tdstInstanciatedPhysicalObject_), E_uwGEONotEnoughtMemory);
p_stInstanciatedPhysicalObject->_hPhysicalObject = NULL;
p_stInstanciatedPhysicalObject->_hRadiosity = NULL;
return (p_stInstanciatedPhysicalObject);
}
/*-----------------------------------------------------------------------------
* Description : Free a Physical Object
*-----------------------------------------------------------------------------
* Creation date : 28/04/97 Author : Sebastien DAVID
*-----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_
void IPO_fn_vFreeInstanciatedPhysicalObject(IPO_tdxHandleToInstanciatedPhysicalObject _hInstanciatedPhysicalObject)
{
Mmg_fn_vFree4Ch(_hInstanciatedPhysicalObject,C_ucMmgDefaultChannel);
}
#endif /* _FIRE_DEADCODE_U64_ */
/* ***************************************************************************** */
/* ******************** Access functions to Objects in IPO *********************** */
/* ***************************************************************************** */
/*-----------------------------------------------------------------------------
* Description : Get the PhysicalObject in a Instanciated Physical Object
*-----------------------------------------------------------------------------
* Creation date : 28/04/97 Author : Sebastien DAVID
*-----------------------------------------------------------------------------*/
PO_tdxHandleToPhysicalObject IPO_fn_hGetPhysicalObject(IPO_tdxHandleToInstanciatedPhysicalObject _hInstanciatedPhysicalObject)
{
return(_hInstanciatedPhysicalObject->_hPhysicalObject);
}
/*-----------------------------------------------------------------------------
* Description : Set the PhysicalObject in a Instanciated Physical Object
*-----------------------------------------------------------------------------
* Creation date : 28/04/97 Author : Sebastien DAVID
*-----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_
void IPO_fn_vSetPhysicalObject(IPO_tdxHandleToInstanciatedPhysicalObject _hInstanciatedPhysicalObject
,PO_tdxHandleToPhysicalObject _hPhysicalObject)
{
_hInstanciatedPhysicalObject->_hPhysicalObject = _hPhysicalObject;
}
#endif /* _FIRE_DEADCODE_U64_ */
/*-----------------------------------------------------------------------------
* Description : Get the Radiosity in a Instanciated Physical Object
*-----------------------------------------------------------------------------
* Creation date : 28/04/97 Author : Sebastien DAVID
*-----------------------------------------------------------------------------*/
ACP_tdxHandleToRadiosity IPO_fn_hGetRadiosity(IPO_tdxHandleToInstanciatedPhysicalObject _hInstanciatedPhysicalObject)
{
return(_hInstanciatedPhysicalObject->_hRadiosity);
}
/*-----------------------------------------------------------------------------
* Description : Set the Radiosity in a Instanciated Physical Object
*-----------------------------------------------------------------------------
* Creation date : 28/04/97 Author : Sebastien DAVID
*-----------------------------------------------------------------------------*/
void IPO_fn_vSetRadiosity(IPO_tdxHandleToInstanciatedPhysicalObject _hInstanciatedPhysicalObject
,ACP_tdxHandleToRadiosity _hRadiosity)
{
_hInstanciatedPhysicalObject->_hRadiosity = _hRadiosity;
}