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,181 @@
# Microsoft Developer Studio Project File - Name="GMT" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=GMT - 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 "Gmt.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 "Gmt.mak" CFG="GMT - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "GMT - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "GMT - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "GMT - Win32 Retail" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/cpa/tempgrp/GMT", MGDAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
!IF "$(CFG)" == "GMT - 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" /I "x:\cpa\public\gmt" /I "x:\cpa\tempgrp\gmt" /I "t:\dxsdk\sdk\inc" /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 /o"tmp\GMT.bsc"
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"x:\cpa\lib\GMTP5_vr.lib"
!ELSEIF "$(CFG)" == "GMT - 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" /I "x:\cpa\public\gmt" /I "x:\cpa\tempgrp\gmt" /I "x:\cpa\public\dnm" /I "t:\dxsdk\sdk\inc" /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 /o"tmp\GMT.bsc"
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"x:\cpa\lib\GMTP5_vd.lib"
!ELSEIF "$(CFG)" == "GMT - Win32 Retail"
# PROP BASE Use_MFC 2
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "GMT___Wi"
# PROP BASE Intermediate_Dir "GMT___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" /I "x:\cpa\public\gmt" /I "x:\cpa\tempgrp\gmt" /I "t:\dxsdk\sdk\inc" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "CPA_WANTS_EXPORT" /D "_GMT_USE_GEOMEM" /D "VISUAL" /FD /c
# SUBTRACT BASE CPP /Fr /YX
# ADD CPP /nologo /G5 /W3 /GX /O2 /I "x:\cpa\public" /I "x:\cpa\public\gmt" /I "x:\cpa\tempgrp\gmt" /I "t:\dxsdk\sdk\inc" /D "NDEBUG" /D "VISUAL" /D "WIN32" /D "RETAIL" /FD /c
# SUBTRACT CPP /Fr /YX
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo /o"tmp\GMT.bsc"
# ADD BSC32 /nologo /o"tmp\GMT.bsc"
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"x:\cpa\lib\GMTP5_vr.lib"
# ADD LIB32 /nologo /out:"x:\cpa\lib\GMTP5_vf.lib"
!ENDIF
# Begin Target
# Name "GMT - Win32 Release"
# Name "GMT - Win32 Debug"
# Name "GMT - Win32 Retail"
# Begin Source File
SOURCE=.\cpagmt.c
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\ErmGmt.h
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT.h
# End Source File
# Begin Source File
SOURCE=.\Gmt.mak
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\GmtFunct.h
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\GmtHandl.h
# End Source File
# Begin Source File
SOURCE=.\GmtInit.c
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\GmtLnkTb.h
# End Source File
# Begin Source File
SOURCE=.\PC\GmtLoad.c
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\GmtLoad.h
# End Source File
# Begin Source File
SOURCE=.\GmtMacro.h
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\GmtProto.h
# End Source File
# Begin Source File
SOURCE=.\GmtStruc.h
# End Source File
# Begin Source File
SOURCE=.\GmtVFunc.c
# End Source File
# Begin Source File
SOURCE=.\GmtVProt.h
# End Source File
# Begin Source File
SOURCE=.\PC\GmtZnLod.c
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\GmtZnLod.h
# End Source File
# Begin Source File
SOURCE=.\GmtZone.c
# End Source File
# Begin Source File
SOURCE=..\..\public\GMT\MmgGmt.h
# End Source File
# End Target
# End Project

View File

@@ -0,0 +1,372 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="GMT"
ProjectGUID="{6088D49D-5C11-46B6-8E10-D87312D7F27B}"
SccProjectName="&quot;$/cpa/tempgrp/GMT&quot;, MGDAAAAA"
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,x:\cpa\public\gmt,x:\cpa\tempgrp\gmt,t:\dxsdk\sdk\inc"
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;RETAIL"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\tmp/retail/GMT.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\GMTP5_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="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,x:\cpa\public\gmt,x:\cpa\tempgrp\gmt,x:\cpa\public\dnm,t:\dxsdk\sdk\inc"
PreprocessorDefinitions="_DEBUG;VISUAL;WIN32;USE_PROFILER;MTH_CHECK;CPA_WANTS_EXPORT"
RuntimeLibrary="3"
PrecompiledHeaderFile=".\Tmp\Debug/GMT.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\GMTP5_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>
<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,x:\cpa\public\gmt,x:\cpa\tempgrp\gmt,t:\dxsdk\sdk\inc"
PreprocessorDefinitions="NDEBUG;VISUAL;WIN32;USE_PROFILER"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
PrecompiledHeaderFile=".\Tmp\Release/GMT.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\GMTP5_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>
</Configurations>
<References>
</References>
<Files>
<File
RelativePath="cpagmt.c">
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\public\GMT\ErmGmt.h">
</File>
<File
RelativePath="..\..\public\GMT.h">
</File>
<File
RelativePath="Gmt.mak">
</File>
<File
RelativePath="..\..\public\GMT\GmtFunct.h">
</File>
<File
RelativePath="..\..\public\GMT\GmtHandl.h">
</File>
<File
RelativePath="GmtInit.c">
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\public\GMT\GmtLnkTb.h">
</File>
<File
RelativePath="PC\GmtLoad.c">
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\public\GMT\GmtLoad.h">
</File>
<File
RelativePath="GmtMacro.h">
</File>
<File
RelativePath="..\..\public\GMT\GmtProto.h">
</File>
<File
RelativePath="GmtStruc.h">
</File>
<File
RelativePath="GmtVFunc.c">
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="GmtVProt.h">
</File>
<File
RelativePath="PC\GmtZnLod.c">
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\public\GMT\GmtZnLod.h">
</File>
<File
RelativePath="GmtZone.c">
<FileConfiguration
Name="Retail|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\public\GMT\MmgGmt.h">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,79 @@
/* (c) Ubi R&D 1997*/
/* See Alain Robin for any comment or question*/
/****************************************************************************/
/* INCLUDES */
/****************************************************************************/
#include "cpa_std.h"
#include "acp_base.h"
#include "MTH.h"
#include "SCR.h"
#define __DeclareGlobalFunctionPointersVariableGmt_h__ /* For function pointers declarations */
#include "GmtStruc.h" /* structure definition*/
#undef __DeclareGlobalFunctionPointersVariableGmt_h__
#include "GmtFunct.h" /* access function definition*/
#include "GMTProto.h"
#include "GmtVProt.h"
/*---------------------------------------------------------------------------/
// Description : GMT_fn_vInitFor3DOS
// Must be called before anything else
------------------------------------------------------------------------------
// Methods : Affect the correct function pointers
------------------------------------------------------------------------------
// Input :
// Output :
------------------------------------------------------------------------------
// Creation date : Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------*/
void GMT_fn_vInitFor3DOS(void)
{
GMT_p_fn_hVirtualCreate=&GMT_fn_hCreateFor3DOS;
GMT_p_fn_vVirtualCopy=&GMT_fn_vCopyFor3DOS;
/*XB 22/06/99*/
#ifndef U64
GMT_p_fn_vVirtualDestroy=&GMT_fn_vDestroyFor3DOS;
#endif /* U64 */
/*End XB 22/06/99*/
GMT_p_fn_vVirtualInitLoadGameMaterial=&GMT_fn_vInitLoadGameMaterialFor3DOS;
/*XB*/
#ifndef U64
GMT_fn_vInitGameMaterialErrorAndMemory();
#endif /* U64 */
/*End XB*/
}
/*---------------------------------------------------------------------------/
// Description : GMT_fn_vInitForA3D
// Must be called before anything else
------------------------------------------------------------------------------
// Methods : Affect the correct function pointers for using module with A3D
------------------------------------------------------------------------------
// Input :
// Output :
------------------------------------------------------------------------------
// Creation date : Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
/*void GMT_fn_vInitForA3D(void)
{
GMT_p_fn_hVirtualCreate=&GMT_fn_hCreateForA3D;
GMT_p_fn_vVirtualCopy=&GMT_fn_vCopyForA3D;
GMT_p_fn_vVirtualDestroy=&GMT_fn_vDestroyForA3D;
GMT_p_fn_vVirtualInitLoadGameMaterial=&GMT_fn_vInitLoadGameMaterialForA3D;
GMT_fn_vInitGameMaterialErrorAndMemory();
}
*/
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */

View File

@@ -0,0 +1,16 @@
/* (c) Ubi R&D 1996*/
/* See Alain Robin for any comment or question*/
/* For the friend modules only : change functions into macros*/
#define GMT_fn_hGetVisualMaterial GMT_M_hGetVisualMaterial
#define GMT_fn_vSetVisualMaterial GMT_M_vSetVisualMaterial
#define GMT_fn_hGetMechanicsMaterial GMT_M_hGetMechanicsMaterial
#define GMT_fn_vSetMechanicsMaterial GMT_M_vSetMechanicsMaterial
#define GMT_fn_hGetSoundMaterial GMT_M_hGetSoundMaterial
#define GMT_fn_vSetSoundMaterial GMT_M_vSetSoundMaterial
#define GMT_fn_hGetCollideMaterial GMT_M_hGetCollideMaterial
#define GMT_fn_vSetCollideMaterial GMT_M_vSetCollideMaterial

View File

@@ -0,0 +1,131 @@
/* (c) Ubi R&D 1996*/
/* See Alain Robin for any comment or question*/
#ifndef __GAMEMAT_H__
#define __GAMEMAT_H__
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************/
/* STRUCTURES */
/****************************************************************************/
/*
typedef struct GMT_tdstCollideMaterial_
{
short wTypeOfZone; // GMT_C_wZDM or GMT_C_wZDR or GMT_C_wZDE or GMT_C_ZDD
GMT_tdxMask xIdentifier;
} GMT_tdstCollideMaterial;
typedef struct GMT_tdstGameMaterial_
{
ACP_tdxHandleOfMaterial hVisualMaterial ;
DNM_tdxHandleToMecMatCharacteristics hMechanicsMaterial ;
SND_tdxHandleToSoundMaterial hSoundMaterial;
GMT_tdxHandleToCollideMaterial hCollideMaterial ;
struct GMT_tdstGameMaterial_* p_stInitialValues; // To be filled with the loaded values
#ifdef SECTOR_IN_GMT
HIE_tdxHandleToSuperObject hSectorMaterial ;
#endif
} GMT_tdstGameMaterial ;
*/
/****************************************************************************/
/* MACROS */
/****************************************************************************/
/* Definition of the accessor macros for the friend modules*/
/* Rem: handles are pointers*/
#define GMT_M_hGetVisualMaterial(_handle) \
((_handle)->hVisualMaterial)
#define GMT_M_vSetVisualMaterial(_hGameMat,_hVisualMat) \
{ (_hGameMat)->hVisualMaterial=(_hVisualMat); }
#define GMT_M_hGetMechanicsMaterial(_handle) \
((_handle)->hMechanicsMaterial)
#define GMT_M_vSetMechanicsMaterial(_hGameMat,_hMechanicsMat) \
{ (_hGameMat)->hMechanicsMaterial=(_hMechanicsMat); }
#define GMT_M_hGetSoundMaterial(_handle) \
((_handle)->hSoundMaterial)
#define GMT_M_vSetSoundMaterial(_hGameMat,_hSoundMat) \
{ (_hGameMat)->hSoundMaterial=(_hSoundMat); }
#define GMT_M_hGetCollideMaterial(_handle) \
((_handle)->hCollideMaterial)
#define GMT_M_vSetCollideMaterial(_hGameMat,_hCollideMat) \
{ (_hGameMat)->hCollideMaterial=(_hCollideMat); }
#ifdef SECTOR_IN_GMT
#define GMT_M_hGetSectorMaterial(_handle) \
((_handle)->hSectorMaterial)
#define GMT_M_vSetSectorMaterial(_hGameMat,_hSectorMat) \
{ (_hGameMat)->hSectorMaterial=(_hSectorMat); }
#endif /* SECTOR_IN_GMT*/
#define GMT_M_wGetTypeOfCollideMaterial(_handle) \
((_handle)->wTypeOfZone)
#define GMT_M_vSetTypeOfCollideMaterial(_hCollideMat,_wType) \
{ (_hCollideMat)->wTypeOfZone=(_wType); }
#define GMT_M_wGetCollideMaterialIdentifier(_hCollideMat) \
((_hCollideMat)->xIdentifier)
#define GMT_M_vSetCollideMaterialIdentifier(_hCollideMat,_wIdentifier) \
{ (_hCollideMat)->xIdentifier=(_wIdentifier); }
/****************************************************************************/
/* FUNCTION POINTERS */
/****************************************************************************/
#undef __GMTFUNCTIONPOINTERS_EXTERN
#ifndef __DeclareGlobalFunctionPointersVariableGmt_h__
#define __GMTFUNCTIONPOINTERS_EXTERN extern /*external declaration*/
#else /*__DeclareGlobalFunctionPointersVariableGmt_h__*/
#define __GMTFUNCTIONPOINTERS_EXTERN /*replace by nothing : we have to declare*/
#endif /*__DeclareGlobalFunctionPointersVariableGmt_h__*/
__GMTFUNCTIONPOINTERS_EXTERN GMT_tdxHandleToGameMaterial (* GMT_p_fn_hVirtualCreate)(void)
#ifdef __DeclareGlobalFunctionPointersVariableGmt_h__
=NULL
#endif
;
/*XB 22/06/99*/
#ifndef U64
__GMTFUNCTIONPOINTERS_EXTERN void (* GMT_p_fn_vVirtualDestroy)(GMT_tdxHandleToGameMaterial _hOld)
#ifdef __DeclareGlobalFunctionPointersVariableGmt_h__
=NULL
#endif
;
#endif /* U64 */
/*End XB 22/06/99*/
__GMTFUNCTIONPOINTERS_EXTERN void (* GMT_p_fn_vVirtualCopy)(GMT_tdxHandleToGameMaterial _hDst,
GMT_tdxHandleToGameMaterial _hSrc)
#ifdef __DeclareGlobalFunctionPointersVariableGmt_h__
=NULL
#endif
;
__GMTFUNCTIONPOINTERS_EXTERN void (* GMT_p_fn_vVirtualInitLoadGameMaterial)(void)
#ifdef __DeclareGlobalFunctionPointersVariableGmt_h__
=NULL
#endif
;
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif /* __GAMEMAT_H__*/

View File

@@ -0,0 +1,353 @@
/* (c) Ubi R&D 1997*/
/* See Alain Robin for any comment or question*/
/****************************************************************************/
/* INCLUDES */
/****************************************************************************/
#include "cpa_std.h"
#include "acp_base.h"
#include "SCR.h"
#include "GLI/Material.h"
#include "MEC.h"
#include "ErmGmt.h"
#include "GmtStruc.h" /* structure definition*/
#include "GmtProto.h" /* functions prototype*/
#include "GmtFunct.h" /* accessors*/
#include "GmtVProt.h" /* virtual functions implementations*/
#include "GmtLoad.h" /* load functions and defines*/
/*---------------------------------------------------------------------------/
// Description : GMT_fn_hCreateFor3DOS
// Structure creation for 3DOS
------------------------------------------------------------------------------
// Methods : Allocate memory and return the handle
------------------------------------------------------------------------------
// Input :
// Output : The handle to the allocated memory
------------------------------------------------------------------------------
// Creation date : Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------*/
GMT_tdxHandleToGameMaterial GMT_fn_hCreateFor3DOS(void)
{
GMT_tdxHandleToGameMaterial hNewGameMaterial;
MMG_fn_vAddMemoryInfo( MMG_C_lTypeGMT , MMG_C_lSubTypeFor3DOS , 0 );
GEO_M_CPAMalloc(hNewGameMaterial,GMT_tdxHandleToGameMaterial,sizeof(struct GMT_tdstGameMaterial_),E_uwGEONotEnoughtMemory);
if(hNewGameMaterial!=NULL)
{
/* pointers initialization */
DNM_fn_vInvalidateMatCharacteristics(&(hNewGameMaterial->hMechanicsMaterial));
hNewGameMaterial->hVisualMaterial=(ACP_tdxHandleOfMaterial)NULL;
hNewGameMaterial->hSoundMaterial=(SND_tdxHandleToSoundMaterial)GMT_C_InvalidSoundMaterial;
hNewGameMaterial->hCollideMaterial=(GMT_tdxHandleToCollideMaterial)GMT_C_InvalidCollideMaterial;
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/* hNewGameMaterial->p_stInitialValues=NULL;*/
/*END fbolefeysot}*/
#ifdef SECTOR_IN_GMT
hNewGameMaterial->hSectorMaterial=(HIE_tdxHandleToSuperObject)NULL;
#endif /* SECTOR_IN_GMT*/
return hNewGameMaterial;
}
return NULL;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyFor3DOS
// Used to copy an existing game material struct for 3DOS (all fields)
----------------------------------------------------------------------------//
// Methods : Use the "Get" and the "Set" macros to copy the field pointers
----------------------------------------------------------------------------//
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------//
// Creation date : May 97 Author: Alain Robin
----------------------------------------------------------------------------//
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vCopyFor3DOS(GMT_tdxHandleToGameMaterial _hDst, GMT_tdxHandleToGameMaterial _hSrc)
{
ACP_tdxHandleOfMaterial hVisual,hCopyOfVisual;
#ifdef _DEBUG
if((!GMT_fn_b_ulIsValid(_hDst))||(!GMT_fn_b_ulIsValid(_hSrc)))
GMT_fn_vRaiseFatalError();
#endif
/* Duplicate visual material */
hVisual=GMT_fn_hGetVisualMaterial(_hSrc);
GLI_xDuplicateMaterial (&hCopyOfVisual,hVisual);
GMT_M_vSetVisualMaterial(_hDst,hCopyOfVisual);
GMT_M_vSetSoundMaterial(_hDst,GMT_M_hGetSoundMaterial(_hSrc));
GMT_M_vSetCollideMaterial(_hDst,GMT_M_hGetCollideMaterial(_hSrc));
GMT_M_vSetMechanicsMaterial(_hDst,GMT_M_hGetMechanicsMaterial(_hSrc));
#ifdef SECTOR_IN_GMT
GMT_M_vSetSectorMaterial(_hDst,GMT_M_hGetSectorMaterial(_hSrc));
#endif /* SECTOR_IN_GMT */
/* Copy initial values */
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/* if(_hSrc->p_stInitialValues!=NULL)
{
if(_hDst->p_stInitialValues==NULL)
{
_hDst->p_stInitialValues=GMT_fn_hCreateGameMaterial();
memcpy(_hDst->p_stInitialValues,_hSrc->p_stInitialValues,sizeof(struct GMT_tdstGameMaterial_));
}
else
{
memcpy(_hDst->p_stInitialValues,_hSrc->p_stInitialValues,sizeof(struct GMT_tdstGameMaterial_));
}
}
*/
/*END fbolefeysot}*/
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vDestroyFor3DOS
// Delete a created game material handle
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : _hOld : game material handle to delete
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : May 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
/*XB 22/06/99*/
#ifndef U64
void GMT_fn_vDestroyFor3DOS(GMT_tdxHandleToGameMaterial _hOld)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hOld))
GMT_fn_vRaiseFatalError();
#endif
/* Free initial values if needed */
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/* if(_hOld->p_stInitialValues!=NULL)
GEO_M_CPAFree(_hOld->p_stInitialValues);
*/
/*END fbolefeysot}*/
/* Free allocated structure */
GEO_M_CPAFree(_hOld);
}
#endif /* U64 */
/*End XB 22/06/99*/
/*---------------------------------------------------------------------------/
// Description : GMT_fn_hCreateForA3D
// Structure creation for 3DOS
------------------------------------------------------------------------------
// Methods : Allocate memory and return the handle
------------------------------------------------------------------------------
// Input :
// Output : The handle to the allocated memory
------------------------------------------------------------------------------
// Creation date : Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
/*GMT_tdxHandleToGameMaterial GMT_fn_hCreateForA3D(void)
{
GMT_tdxHandleToGameMaterial hNewGameMaterial;
MMG_fn_vAddMemoryInfo( MMG_C_lTypeGMT , MMG_C_lSubTypeCollideMaterial , 0 );
GEO_M_CPAMalloc(hNewGameMaterial,GMT_tdxHandleToGameMaterial,sizeof(struct GMT_tdstGameMaterial_),E_uwGEONotEnoughtMemory);
if(hNewGameMaterial!=NULL)
{
// pointers initialization
hNewGameMaterial->hVisualMaterial=(ACP_tdxHandleOfMaterial)NULL;
hNewGameMaterial->hSoundMaterial=(SND_tdxHandleToSoundMaterial)GMT_C_InvalidSoundMaterial;
hNewGameMaterial->hCollideMaterial=(GMT_tdxHandleToCollideMaterial)GMT_C_InvalidCollideMaterial;
hNewGameMaterial->p_stInitialValues=NULL;
#ifdef SECTOR_IN_GMT
hNewGameMaterial->hSectorMaterial=(HIE_tdxHandleToSuperObject)NULL;
#endif // SECTOR_IN_GMT
// We don't initialize the DNM handle to avoid call of dnm function but we set it to NULL
hNewGameMaterial->hMechanicsMaterial=NULL;
return hNewGameMaterial;
}
return NULL;
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyForA3D
// Used to copy an existing game material struct for 3DOS (all fields)
----------------------------------------------------------------------------//
// Methods : Use the "Get" and the "Set" macros to copy the field pointers
----------------------------------------------------------------------------//
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------//
// Creation date : May 97 Author: Alain Robin
----------------------------------------------------------------------------//
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*void GMT_fn_vCopyForA3D(GMT_tdxHandleToGameMaterial _hDst, GMT_tdxHandleToGameMaterial _hSrc)
{
ACP_tdxHandleOfMaterial hVisual,hCopyOfVisual;
#ifdef _DEBUG
if((!GMT_fn_b_ulIsValid(_hDst))||(!GMT_fn_b_ulIsValid(_hSrc)))
GMT_fn_vRaiseFatalError();
#endif
// Duplicate visual material
hVisual=GMT_fn_hGetVisualMaterial(_hSrc);
GLI_xDuplicateMaterial (&hCopyOfVisual,hVisual);
GMT_M_vSetVisualMaterial(_hDst,hCopyOfVisual);
// Copy initial values
if(_hSrc->p_stInitialValues!=NULL)
{
if(_hDst->p_stInitialValues==NULL)
{
_hDst->p_stInitialValues=GMT_fn_hCreateGameMaterial();
memcpy(_hDst->p_stInitialValues,_hSrc->p_stInitialValues,sizeof(struct GMT_tdstGameMaterial_));
}
else
{
memcpy(_hDst->p_stInitialValues,_hSrc->p_stInitialValues,sizeof(struct GMT_tdstGameMaterial_));
}
}
}
*/
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vDestroyForA3D
// Delete a created game material handle
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : _hOld : game material handle to delete
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : May 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
/*void GMT_fn_vDestroyForA3D(GMT_tdxHandleToGameMaterial _hOld)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hOld))
GMT_fn_vRaiseFatalError();
#endif
// Free initial values if needed
if(_hOld->p_stInitialValues!=NULL)
GEO_M_CPAFree(_hOld->p_stInitialValues);
// Free allocated structure
GEO_M_CPAFree(_hOld);
}
*/
#endif
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vInitLoadGameMaterialFor3DOS
// Loading process initialization for 3DOS
//////////////////////////////////////////////////////////////////////////////
// Methods : Register the callbacks
//////////////////////////////////////////////////////////////////////////////
// Input :
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 27 Feb 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Init the link table
// Modification date : 01 Apr 97 Modification author : Alain Robin
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vInitLoadGameMaterialFor3DOS(void)
{
#if !defined(U64)
SCR_fn_v_RdL0_RegisterCallback(C_SectionGameMaterial,fn_eScriptCallBackGameMaterial, SCR_CRC_c_RdL0_ForSection);
/*BEGIN OS 4/3/98*/
/* SCR_fn_v_RdL0_RegisterCallback(C_SectionGameMaterial,fn_eScriptCallBackBinGameMaterial, SCR_CRC_c_RdL0_ForBinSection);*/
/*END OS 4/3/98*/
DNM_fn_vInitLoadMecMatCharacteristics(); /* Register the mechanic callback*/
GMT_fn_vInitLoadCollideMaterial(); /* Register collide material*/
SCR_fn_v_Link_InitTable(&g_stGmtLinkTable);
#endif /* U64 */
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vInitLoadGameMaterialForA3D
// Loading process initialization for A3D
//////////////////////////////////////////////////////////////////////////////
// Methods : Register the callbacks
//////////////////////////////////////////////////////////////////////////////
// Input :
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 27 Feb 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Init the link table
// Modification date : 01 Apr 97 Modification author : Alain Robin
//////////////////////////////////////////////////////////////////////////// */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vInitLoadGameMaterialForA3D(void)
{
#if !defined(U64)
SCR_fn_v_RdL0_RegisterCallback(C_SectionGameMaterial,fn_eScriptCallBackGameMaterial, SCR_CRC_c_RdL0_ForSection);
/*BEGIN OS 4/3/98*/
/* SCR_fn_v_RdL0_RegisterCallback(C_SectionGameMaterial,fn_eScriptCallBackBinGameMaterial, SCR_CRC_c_RdL0_ForBinSection);*/
/*END OS 4/3/98*/
SCR_fn_v_Link_InitTable(&g_stGmtLinkTable);
#endif /* U64 */
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
#if !defined(U64)
char * GMT_fn_p_szZdmMaskToName(GMT_tdxMask _xMask)
{
switch(_xMask)
{
case GMT_C_uwPieds:
return GMT_C_szPieds;
break;
case GMT_C_uwCorps:
return GMT_C_szCorps;
break;
case GMT_C_uwTete:
return GMT_C_szTete;
break;
case GMT_C_uwMains:
return GMT_C_szMains;
break;
case GMT_C_uwFigee:
return GMT_C_szFigee;
break;
case GMT_C_uwDos:
return GMT_C_szDos;
break;
default:
return NULL;
break;
}
}
#endif /* U64 */

View File

@@ -0,0 +1,106 @@
/* (c) Ubi R&D 1997*/
/* See Alain Robin for any comment or question*/
/* Here, we declare the private implementations for the virtual functions */
#ifndef __GMTVPROT_H__
#define __GMTVPROT_H__
/*----------------------------------------------------------------------------
// Description : GMT_fn_hCreateFor3DOS
// To create an empty game material handle
//----------------------------------------------------------------------------
// Input :
// Output : Handle to the created game material
----------------------------------------------------------------------------*/
extern GMT_tdxHandleToGameMaterial GMT_fn_hCreateFor3DOS(void);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vDestroyFor3DOS
// Delete a created game material handle
//----------------------------------------------------------------------------
// Input : _hOld : game material handle to delete
// Output :
----------------------------------------------------------------------------*/
extern void GMT_fn_vDestroyFor3DOS(GMT_tdxHandleToGameMaterial _hOld);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyFor3DOS
// Used to copy an existing game material
//----------------------------------------------------------------------------
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------*/
extern void GMT_fn_vCopyFor3DOS(GMT_tdxHandleToGameMaterial _hDst, GMT_tdxHandleToGameMaterial _hSrc);
/*----------------------------------------------------------------------------
// Description : GMT_fn_hCreateForA3D
// To create an empty game material handle
//----------------------------------------------------------------------------
// Input :
// Output : Handle to the created game material
----------------------------------------------------------------------------*/
/*extern GMT_tdxHandleToGameMaterial GMT_fn_hCreateForA3D(void);*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vDestroyForA3D
// Delete a created game material handle
//----------------------------------------------------------------------------
// Input : _hOld : game material handle to delete
// Output :
----------------------------------------------------------------------------*/
extern void GMT_fn_vDestroyForA3D(GMT_tdxHandleToGameMaterial _hOld);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyForA3D
// Used to copy an existing game material
//----------------------------------------------------------------------------
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------*/
extern void GMT_fn_vCopyForA3D(GMT_tdxHandleToGameMaterial _hDst, GMT_tdxHandleToGameMaterial _hSrc);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vInitLoadGameMaterialFor3DOS
// Loading process initialization for 3DOS
----------------------------------------------------------------------------//
// Input :
// Output :
----------------------------------------------------------------------------*/
extern void GMT_fn_vInitLoadGameMaterialFor3DOS(void);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vInitLoadGameMaterialForA3D
// Loading process initialization for A3D
----------------------------------------------------------------------------//
// Input :
// Output :
----------------------------------------------------------------------------*/
extern void GMT_fn_vInitLoadGameMaterialForA3D(void);
/*----------------------------------------------------------------------------
// Description : fn_eScriptCallBackGameMaterial
// Reads the script file describing a game material
----------------------------------------------------------------------------//
// Input : script input
// Output : script output
----------------------------------------------------------------------------*/
#if !defined(U64)
SCR_tde_Anl_ReturnValue fn_eScriptCallBackGameMaterial(
SCR_tdst_File_Description *p_stHandle,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction);
/*BEGIN OS 4/3/98*/
SCR_tde_Anl_ReturnValue fn_eScriptCallBackBinGameMaterial(
SCR_tdst_File_Description *p_stHandle,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction);
/*END OS 4/3/98*/
#endif /* U64 */
#endif /*__GMTVPROT_H__*/

View File

@@ -0,0 +1,75 @@
#include "ldt.h"
/*****************************************************************
Name:
Description: Create callback for LDT
Author: Mircea Petrescu
Date: 8/25/98
Modified:
*****************************************************************/
int fn_iCreateCollideMaterial( LDT_tdst_Link *pLink )
{
GMT_tdxHandleToCollideMaterial h_CollideMaterial;
h_CollideMaterial = GMT_fn_hCreateCollideMaterial();
pLink->pObject=(void *)h_CollideMaterial;
return 0;
}
/*****************************************************************
Name:
Description: Load callback for LDT
Author: Mircea Petrescu
Date: 8/25/98
Modified:
*****************************************************************/
int fn_iLoadCollideMaterial( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
GMT_tdxHandleToCollideMaterial _h_CollideMaterial=(GMT_tdxHandleToCollideMaterial)pLink->pObject;
char a255_cLongName[255];
int iLen;
iLen=LDT_ComputeSectionName(pLink,a255_cLongName);
SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(&g_stGmtZoneLinkTable,
a255_cLongName,
(unsigned long)_h_CollideMaterial),
1,iLen);
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
short wValue;
char *szEntry=LDT_szGetEntryName();
if( strcmp( szEntry, C_EntryCollideMaterial )!=0 )
break;
szEntry=LDT_szGetParam(1);
switch( *(long *)szEntry )
{
case 'mdZ' : /* Zdm */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDM);
break;
case 'rdZ' : /* Zdr */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDR);
break;
case 'edZ' : /* Zde */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDE);
break;
case 'ddZ' : /* Zdd */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDD);
break;
}
wValue=(short)atoi( LDT_szGetParam( 2 ) );
GMT_fn_hSetCollideMaterialIdentifier(_h_CollideMaterial,wValue);
}
}
}
return 0;
}

View File

@@ -0,0 +1,343 @@
/* (c) Ubi R&D 1997*/
/* See Alain Robin for any comment or question*/
/****************************************************************************/
/* INCLUDES */
/****************************************************************************/
#include "acp_base.h"
#include "MTH.h"
#include "GEO.h"
#include "GLI.h"
#include "ErmGmt.h"
#include "GmtStruc.h" /* structure definition*/
#include "GmtFunct.h" /* access function definition*/
#include "GmtProto.h" /* complex function definition*/
/****************************************************************************/
/* BASIC FUNCTIONS FOR COLLIDE MATERIAL */
/****************************************************************************/
/*----------------------------------------------------------------------------
// Description : GMT_fn_hCreateCollideMaterial
// To create an empty collide material handle
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input :
// Output : Handle to the created collide material
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
GMT_tdxHandleToCollideMaterial GMT_fn_hCreateCollideMaterial(void)
{
GMT_tdxHandleToCollideMaterial hNewCollideMaterial;
MMG_fn_vAddMemoryInfo( MMG_C_lTypeGMT , MMG_C_lSubTypeForA3D , 0 );
GEO_M_CPAMalloc(hNewCollideMaterial,GMT_tdxHandleToCollideMaterial,sizeof(struct GMT_tdstCollideMaterial_),E_uwGEONotEnoughtMemory);
if(hNewCollideMaterial!=NULL)
{
/* initialization */
hNewCollideMaterial->wTypeOfZone=-1;
hNewCollideMaterial->xIdentifier=0; /* All bits set to 0*/
return hNewCollideMaterial;
}
return NULL;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vDestroyCollideMaterial
// Delete a created collide material handle
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _p_hOld : collide material handle to delete
// Output :
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vDestroyCollideMaterial(GMT_tdxHandleToCollideMaterial* _p_hOld)
{
GEO_M_CPAFree(*_p_hOld);
*_p_hOld=GMT_C_InvalidCollideMaterial;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyGameMaterial
// Used to copy an existing game material
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vCopyCollideMaterial(GMT_tdxHandleToCollideMaterial _hDst, GMT_tdxHandleToCollideMaterial _hSrc)
{
GMT_M_vSetTypeOfCollideMaterial(_hDst,GMT_M_wGetTypeOfCollideMaterial(_hSrc));
GMT_M_vSetCollideMaterialIdentifier(_hDst,GMT_M_wGetCollideMaterialIdentifier(_hSrc));
}
/****************************************************************************/
/* ACCESSORS FOR COLLIDE MATERIAL */
/****************************************************************************/
/*----------------------------------------------------------------------------
// Description : GMT_fn_wGetTypeOfCollideMaterial
// Used to get the type of the collide material
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the collide material
// Output : GMT_C_wZDM or GMT_C_wZDR or GMT_C_wZDE
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
short GMT_fn_wGetTypeOfCollideMaterial(GMT_tdxHandleToCollideMaterial _hCollideMat)
{
return GMT_M_wGetTypeOfCollideMaterial(_hCollideMat);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetTypeOfCollideMaterial
// Used to set the type of the collide material
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the game material
// GMT_C_wZDM or GMT_C_wZDR or GMT_C_wZDE
// Output :
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vSetTypeOfCollideMaterial(GMT_tdxHandleToCollideMaterial _hCollideMat, short _wType)
{
GMT_M_vSetTypeOfCollideMaterial(_hCollideMat,_wType);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_hGetCollideMaterialIdentifier
// Used to get the identifier of the collide material
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the collide material
// Output : the identifier
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
GMT_tdxMask GMT_fn_hGetCollideMaterialIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat)
{
return GMT_M_wGetCollideMaterialIdentifier(_hCollideMat);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_hSetCollideMaterialIdentifier
// Used to set the collide identifier part of the collide material
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the collide material
// the identifier
// Output :
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_hSetCollideMaterialIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,GMT_tdxMask _xIdentifier)
{
GMT_M_vSetCollideMaterialIdentifier(_hCollideMat,_xIdentifier);
}
/****************************************************************************/
/* MORE COMPLEX FUNCTIONS */
/****************************************************************************/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetCollideMaterialTypeOfIdentifier
// Set to 1 the corresponding bit of the identifier
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the collide material
// _uwType : Number of the type (0 to 15)
// Output :
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vSetCollideMaterialTypeOfIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
unsigned short _uwType)
{
unsigned short uwMask;
unsigned short uwIdentifier;
uwMask=0x0001;
uwMask=uwMask<<_uwType;
uwIdentifier = (unsigned short)GMT_fn_hGetCollideMaterialIdentifier(_hCollideMat);
GMT_M_vSetCollideMaterialIdentifier(_hCollideMat,(uwIdentifier|uwMask));
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vResetCollideMaterialType
// Set to 0 the corresponding bit of the identifier
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the collide material
// _uwType : Number of the type (0 to 15)
// Output :
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vResetCollideMaterialTypeOfIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
unsigned short _uwType)
{
unsigned short uwMask;
unsigned short uwIdentifier;
uwMask=0x0001;
uwMask=uwMask<<_uwType;
uwMask=~uwMask;
uwIdentifier = (unsigned short)GMT_fn_hGetCollideMaterialIdentifier(_hCollideMat);
GMT_M_vSetCollideMaterialIdentifier(_hCollideMat,(uwIdentifier&uwMask));
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*----------------------------------------------------------------------------
// Description : GMT_fn_xTestCollideMaterialType
// Test the corresponding bit of the identifier
----------------------------------------------------------------------------//
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _hCollideMat : Handle to the collide material
// _uwType : Number of the type (0 to 15)
// Output : TRUE if the bit is set to 1 FALSE else
----------------------------------------------------------------------------//
// Modification :
// Mdofication date : Modification author :
----------------------------------------------------------------------------*/
ACP_tdxBool GMT_fn_xTestCollideMaterialTypeOfIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
unsigned short _uwType)
{
unsigned short uwMask;
unsigned short uwIdentifier;
uwMask=0x0001;
uwMask=uwMask<<_uwType;
uwIdentifier = (unsigned short)GMT_fn_hGetCollideMaterialIdentifier(_hCollideMat);
uwMask=uwMask&uwIdentifier;
if(uwMask==0)
return FALSE;
else
return TRUE;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_xMultipleTestCollideIdentifier
// Test the collide type for the identifier (test several bits in one operation)
------------------------------------------------------------------------------
// Method : Logical operation
------------------------------------------------------------------------------
// Input : _hCollideMat : Handle to the collide material
// _xType : Mask containing the bits to test
// Output : TRUE if all the bits set in _xType are present into the collide material
// identifier, FALSE else
------------------------------------------------------------------------------
// Creation date : May 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
ACP_tdxBool GMT_fn_xMultipleTestCollideIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
GMT_tdxMask _xType)
{
GMT_tdxMask xIdentifier;
xIdentifier = GMT_fn_hGetCollideMaterialIdentifier(_hCollideMat);
xIdentifier = xIdentifier&_xType;
if(xIdentifier==_xType)
return TRUE;
else
return FALSE;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_xCombineMask
// Combine 2 GMT_tdxMask and return the result
------------------------------------------------------------------------------
// Method : Logical operation
------------------------------------------------------------------------------
// Input : _xMaskA, _xMaskB : The 2 masks to combine
// Output : the combinaison
------------------------------------------------------------------------------
// Creation date : May 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
GMT_tdxMask GMT_fn_xCombineMask(GMT_tdxMask _xMaskA,GMT_tdxMask _xMaskB)
{
return (_xMaskA|_xMaskB);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetEntireMask
// Set all the bits of a mask to 1
------------------------------------------------------------------------------
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _p_xMask : pointer to the mask
// Output :
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vSetEntireMask(GMT_tdxMask* _p_xMask)
{
*_p_xMask=0xffff;
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/*----------------------------------------------------------------------------
// Description : GMT_fn_vResetEntireMask
// Set all the bits of a mask to 0
------------------------------------------------------------------------------
// Method : Nothing to say
----------------------------------------------------------------------------//
// Input : _xMask : The mask
// Output :
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vResetEntireMask(GMT_tdxMask* _p_xMask)
{
*_p_xMask=0x0000;
}

View File

@@ -0,0 +1,815 @@
/* (c) Ubi R&D 1997*/
/* See Alain Robin for any comment or question*/
/****************************************************************************/
/* INCLUDES */
/****************************************************************************/
#include "acp_base.h"
#include "cpa_std.h"
#define __DeclareGlobalVariableGmtLnkTb_h__
#include "GmtLnkTb.h"
#undef __DeclareGlobalVariableGmtLnkTb_h__
#include "MTH.h"
#include "SCR.h"
#include "DPT.h"
/*#include "BIN.h"*/
#include "GEO.h"
#include "GLI.h"
#include "GmtStruc.h"
#include "GmtFunct.h"
#include "GmtProto.h"
#include "GmtLoad.h"
#include "GmtZnLod.h"
#include "MEC/DNMLdMat.h"
#include "MEC/DNMLkMat.h"
/*////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vAddEntryIntoLinkTable
// Add an entry into the link table of the game material module
//////////////////////////////////////////////////////////////////////////////
// Methods : Private function
//////////////////////////////////////////////////////////////////////////////
// Input : _ulValue : value of the handle to the created game material
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 01 Apr 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
////////////////////////////////////////////////////////////////////////////*/
void GMT_fn_vAddEntryIntoLinkTable(unsigned long _ulValue)
{
/* char* szSectionName;
// char* szPathName;
char szCompleteName[255];
char* p_cSubString; */
/* szSectionName=strchr(SCR_M_RdL0_GetCompleteSectionNameR(0), '^');
szPathName=fn_szGetGameMaterialDataPath();
strcpy(szCompleteName,szPathName);
strcat(szCompleteName,"\\");
strcat(szCompleteName,szSectionName); */ /* Old data organisation*/
/* strcpy(szCompleteName,szSectionName);*/
/* strcpy(szCompleteName, SCR_M_RdL0_GetOpenFileNameR(0));
strcat(szCompleteName, szSectionName);
SCR_fnp_st_Link_SetValue(&g_stGmtLinkTable,szCompleteName,_ulValue);
// Compute index of short name
p_cSubString=strstr(szCompleteName,SCR_M_RdL0_GetCompleteSectionNameR(0));
if(p_cSubString!=NULL)
{
SCR_tdst_Link_Value* pValue;
pValue=SCR_fnp_st_Link_SearchKey(&g_stGmtLinkTable,szCompleteName);
SCR_M_v_Link_SetAdditionalLong(pValue,1,(ACP_tdxIndex)(p_cSubString-szCompleteName));
} */
char a255_cLongName[255];
SCR_M_RdL0_ComputeOpenSectionNameR(0,a255_cLongName);
SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(&g_stGmtLinkTable,
a255_cLongName,
_ulValue),1,
strlen(a255_cLongName)-strlen(SCR_M_RdL0_GetCompleteSectionNameR(0)));
}
/*////////////////////////////////////////////////////////////////////////////
// Description : fn_eScriptFillGameMaterial
// Fills in a game material
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : Handle to the game material + script inputs
// Output : scripts output
//////////////////////////////////////////////////////////////////////////////
// Creation date : 26 Feb 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
////////////////////////////////////////////////////////////////////////////*/
SCR_tde_Anl_ReturnValue fn_eScriptFillGameMaterial(
GMT_tdxHandleToGameMaterial _h_GameMaterial,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction
)
{
/* char *szPath;*/
char szCompleteName[255];
SCR_tde_Anl_ReturnValue eReturnValue = R_SCRIPT_NormalReturn;
if(!strcmp(szAction,C_EntryVisualGameMaterialToLoad))
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
ACP_tdxHandleOfMaterial hVisualMat;
/* Construct the complete file name */
if(*d_szPars[0]!='*')
{
/* szPath=fn_szGetVisualMaterialDataPath();
strcpy(szCompleteName,szPath);
strcat(szCompleteName,"\\");
strcat(szCompleteName,d_szPars[0]); */ /* Old organisation*/
strcpy(szCompleteName,d_szPars[0]);
}
else
strcpy(szCompleteName,d_szPars[0]);
/* Call the callback of visual material */
/* And Put the Handle in the structure GameMaterial Handled */
p_stValues = SCR_fnp_st_RdL0_AnalyseSection(szCompleteName,SCR_CDF_uw_Anl_Normal);
if(p_stValues)
{
ulResult = p_stValues->a_ulValues[0];
hVisualMat=(ACP_tdxHandleOfMaterial)ulResult;
GMT_fn_vSetVisualMaterial(_h_GameMaterial,hVisualMat);
}
}
else if(!strcmp(szAction,C_EntryMechanicalMaterialToLoad))
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
/* Construct the complete file name */
if(*d_szPars[0]!='*')
{
/* szPath=fn_szGetMechanicsMaterialDataPath();
strcpy(szCompleteName,szPath);
strcat(szCompleteName,"\\");
strcat(szCompleteName,d_szPars[0]); */
strcpy(szCompleteName,d_szPars[0]);
}
else
strcpy(szCompleteName,d_szPars[0]);
/* Call the call back for the other properties into the .miv file */
/* and put the handles into the structure GameMaterial Handled */
p_stValues = SCR_fnp_st_RdL0_AnalyseSection(szCompleteName,SCR_CDF_uw_Anl_Normal);
if(p_stValues)
{
ulResult = p_stValues->a_ulValues[0];
GMT_fn_vSetMechanicsMaterial(_h_GameMaterial,(DNM_tdxHandleToMecMatCharacteristics)ulResult);
}
}
else if(!strcmp(szAction,C_EntryCollideMaterialToLoad))
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
/* Construct the complete file name */
if(*d_szPars[0]!='*')
{
/* szPath=fn_szGetCollideMaterialDataPath();
strcpy(szCompleteName,szPath);
strcat(szCompleteName,"\\");
strcat(szCompleteName,d_szPars[0]); */
strcpy(szCompleteName,d_szPars[0]);
}
else
strcpy(szCompleteName,d_szPars[0]);
/* Call the call back for the other properties into the .miv file */
/* and put the handles into the structure GameMaterial Handled */
p_stValues = SCR_fnp_st_RdL0_AnalyseSection(szCompleteName,SCR_CDF_uw_Anl_Normal);
if(p_stValues)
{
ulResult = p_stValues->a_ulValues[0];
GMT_fn_vSetCollideMaterial(_h_GameMaterial,(GMT_tdxHandleToCollideMaterial)ulResult);
}
}
else if(!strcmp(szAction,C_EntrySoundMaterial))
{
long lValue;
lValue=(long)atoi(d_szPars[0]);
GMT_fn_vSetSoundMaterial(_h_GameMaterial,lValue);
}
/*else if(!strcmp(szAction,C_Entry?)) */
/*{ */
/* Call The CallBackOf? */
/*} */
else
{
/* Manage the Treatment of an Error */
/* To be Done */
}
return(eReturnValue);
}
/*////////////////////////////////////////////////////////////////////////////
// Description : fn_eScriptCallBackGameMaterial
// Reads the script file describing a game material
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : script input
// Output : script output
//////////////////////////////////////////////////////////////////////////////
// Creation date : 26 Feb 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
////////////////////////////////////////////////////////////////////////////*/
SCR_tde_Anl_ReturnValue fn_eScriptCallBackGameMaterial(
SCR_tdst_File_Description *p_stHandle,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction)
{
GMT_tdxHandleToGameMaterial h_GameMaterial;
SCR_tde_Anl_ReturnValue eReturnValue = R_SCRIPT_NormalReturn;
if(eAction==C_SCRIPT_Section)
{
/* If a section is detected */
/* Allocates */
h_GameMaterial = GMT_fn_hCreateGameMaterial();
SCR_M_RdL0_SetSectionLong(0, 0, (unsigned long)(h_GameMaterial))
GMT_fn_vAddEntryIntoLinkTable((unsigned long)h_GameMaterial);
}
else if(eAction==C_SCRIPT_Entry)
{
/*--------------------------*/
/* Fills the game material */
/*--------------------------*/
SCR_M_RdL0_GetSectionLong(0, 0, GMT_tdxHandleToGameMaterial, h_GameMaterial)
fn_eScriptFillGameMaterial(
h_GameMaterial,
szAction,
d_szPars,
eAction);
}
else if(eAction==C_SCRIPT_EndSection)
{
/* Store loaded GMT */
SCR_M_RdL0_GetSectionLong(0, 0, GMT_tdxHandleToGameMaterial, h_GameMaterial)
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/* h_GameMaterial->p_stInitialValues = GMT_fn_hCreateGameMaterial();
memcpy(h_GameMaterial->p_stInitialValues,h_GameMaterial,sizeof(struct GMT_tdstGameMaterial_));
h_GameMaterial->p_stInitialValues->p_stInitialValues=NULL;
*/
/*END fbolefeysot}*/
}
return(eReturnValue);
}
/*////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vInitLoadGameMaterial
// Loading process initialization
//////////////////////////////////////////////////////////////////////////////
// Methods : Register the callback
//////////////////////////////////////////////////////////////////////////////
// Input :
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 27 Feb 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Init the link table
// Modification date : 01 Apr 97 Modification author : Alain Robin
////////////////////////////////////////////////////////////////////////////*/
void GMT_fn_vInitLoadGameMaterial(void)
{
/* SCR_fn_v_RdL0_RegisterCallback(C_SectionGameMaterial,fn_eScriptCallBackGameMaterial, SCR_CRC_c_RdL0_ForSection);
DNM_fn_vInitLoadMecMatCharacteristics(); // Register the mechanic callback
GMT_fn_vInitLoadCollideMaterial(); // Register collide material
SCR_fn_v_Link_InitTable(&g_stGmtLinkTable); */
if(GMT_p_fn_vVirtualInitLoadGameMaterial!=NULL)
GMT_p_fn_vVirtualInitLoadGameMaterial();
}
/*---------------------------------------------------------------------------/
// Description : GMT_fn_vDeleteGMTEntryWithPriority
------------------------------------------------------------------------------
// Methods :
------------------------------------------------------------------------------
// Input :
// Output :
------------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author : Alain Robin
---------------------------------------------------------------------------/*/
void GMT_fn_vDeleteGMTEntryWithPriority(unsigned char ucPrioMin, unsigned char ucPrioMax)
{
SCR_fn_v_Link_DeleteEntryWithPriority(&g_stGmtLinkTable,ucPrioMin,ucPrioMax);
}
/*////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_p_stGetLinkTable
// Get the link table of the game material module
//////////////////////////////////////////////////////////////////////////////
// Methods : Nothing to say
//////////////////////////////////////////////////////////////////////////////
// Input :
// Output : A pointer to the static link table
//////////////////////////////////////////////////////////////////////////////
// Creation date : 01 Apr 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
////////////////////////////////////////////////////////////////////////////*/
REF_tdstLinkTable* GMT_fn_p_stGetLinkTable()
{
return &g_stGmtLinkTable;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_hLoadGameMaterial
// Load a game material from the scripts or from the binary bloc
//----------------------------------------------------------------------------
// Methods : For the moment, use the script
//----------------------------------------------------------------------------
// Input : _szSectionName : Name of the section to load
// Output : A handle to the loaded game material
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
GMT_tdxHandleToGameMaterial GMT_fn_hLoadGameMaterial(char* _szSectionName)
{
SCR_tdst_Cxt_Values *p_stValues ;
SCR_tdst_Link_Value *p_stLinkValue = NULL;
unsigned long ulResult;
unsigned int uiPos;
uiPos = 0;
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value, uiPos, p_stLinkValue,SCR_M_st_Link_GetDynamicArray(GMT_fn_p_stGetLinkTable()));
while(p_stLinkValue)
{
if(!strcmpi(SCR_M_p_sz_Link_GetKey(p_stLinkValue) + SCR_M_ul_Link_GetAdditionalLong(p_stLinkValue,1),_szSectionName))
break;
uiPos++;
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value, uiPos, p_stLinkValue,SCR_M_st_Link_GetDynamicArray(GMT_fn_p_stGetLinkTable()));
}
/* p_stLinkValue=BIN_fn_p_stSearchShortKey(GMT_fn_p_stGetLinkTable(),_szSectionName);*/
if(p_stLinkValue==NULL)
{
p_stValues = SCR_fnp_st_RdL0_AnalyseSection(_szSectionName,SCR_CDF_uw_Anl_Normal);
if(p_stValues)
{
ulResult = SCR_M_ul_RdL0_ExtractLongValue(p_stValues,0);
return (GMT_tdxHandleToGameMaterial)ulResult;
}
else
return (GMT_tdxHandleToGameMaterial)GMT_C_ulInvalidHandle;
}
else return (GMT_tdxHandleToGameMaterial)p_stLinkValue->ulValue;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vPrepareSaveBinaryBloc
//----------------------------------------------------------------------------
// Methods : Prepare data for a binary save and call the save structure
// function for all loaded gmt
//----------------------------------------------------------------------------
// Input :
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vPrepareSaveBinaryBloc()
{
BIN_fn_vCreateBinaryIds(&g_stGmtLinkTable,BIN_C_GMTID);
// Now, the structures under the game material
GLI_fn_vPrepareSaveMaterialBinaryBloc(); // For visual mat
DNM_fn_vPrepareSaveMaterialBinaryBloc(); // for mechanics
GMT_fn_vPrepareSaveCollideBinaryBloc(); // For collision
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vWriteBinaryBloc
//----------------------------------------------------------------------------
// Methods : Write the binary bloc into a buffer and flush the buffer into a
// file.
//----------------------------------------------------------------------------
// Input : _hGmtMaterial : Handle to the game material to save
// _p_cBuffer : Binarisation buffer
// Output : The length of the data written
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
unsigned long GMT_fn_ulWriteBinaryBloc(unsigned long _ulGmtMaterial,char* _p_cBuffer)
{
char* p_cBuffer=_p_cBuffer;
GMT_tdxHandleToGameMaterial hGameMaterial;
ACP_tdxHandleOfMaterial hVisualMaterial;
hGameMaterial=(GMT_tdxHandleToGameMaterial)_ulGmtMaterial;
// Visual
hVisualMaterial=GMT_fn_hGetVisualMaterial(hGameMaterial);
p_cBuffer=BIN_fn_p_cPutPointer(p_cBuffer,(unsigned long)hVisualMaterial, GLI_p_stGetLinkTableOfVisualMaterial());
// Mechanics
if(DNM_fn_bIsMatCharacteristicsValid(GMT_fn_hGetMechanicsMaterial(hGameMaterial)))
{
p_cBuffer=BIN_fn_p_cPutPointer(p_cBuffer,(unsigned long)GMT_fn_hGetMechanicsMaterial(hGameMaterial),
DNM_fn_p_stGetLinkTableOfMecMatCharacteristics());
}
else
{
p_cBuffer=BIN_fn_p_cPutLong(p_cBuffer,(long)0);
}
// Sound
p_cBuffer=BIN_fn_p_cPutLong(p_cBuffer,GMT_fn_hGetSoundMaterial(hGameMaterial));
// Collide
if(GMT_fn_hGetCollideMaterial(hGameMaterial)!=GMT_C_InvalidCollideMaterial)
{
p_cBuffer=BIN_fn_p_cPutPointer(p_cBuffer,(unsigned long)GMT_fn_hGetCollideMaterial(hGameMaterial),
&g_stGmtZoneLinkTable);
}
else
{
p_cBuffer=BIN_fn_p_cPutLong(p_cBuffer,(long)0);
}
// The place for the initial values
p_cBuffer=BIN_fn_p_cPutLong(p_cBuffer,0);
return p_cBuffer-_p_cBuffer;
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vWriteAllGameMaterialBinaryBlocs
//----------------------------------------------------------------------------
// Methods : Write all the game materials into a binary file.
//----------------------------------------------------------------------------
// Input : _szBinaryFileName : Name of the binary file
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vWriteAllGameMaterialBinaryBlocs(char* _szBinaryFileName)
{
GMT_fn_vPrepareSaveBinaryBloc();
BIN_fn_vPutBinaryDataIntoFileFromLinkTable( (char*)_szBinaryFileName,
&g_stGmtLinkTable,
sizeof(GMT_tdstGameMaterial),
GMT_fn_ulWriteBinaryBloc);
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vRestorePointerFromIds
//----------------------------------------------------------------------------
// Methods : Write all the game materials into a binary file.
//----------------------------------------------------------------------------
// Input : _ulPointer : Pointer to the structure to be restored
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vRestorePointerFromIds(unsigned long _ulPointer)
{
unsigned long ulId;
GMT_tdxHandleToGameMaterial hGameMaterial=(GMT_tdxHandleToGameMaterial)_ulPointer;
// Visual
ulId=(unsigned long)GMT_fn_hGetVisualMaterial(hGameMaterial);
if(ulId!=0)
{
BIN_fn_p_cGetPointer((char*)&hGameMaterial->hVisualMaterial,(unsigned long*)&hGameMaterial->hVisualMaterial,
GLI_p_stGetLinkTableOfVisualMaterial());
}
else
{
// We must create a default material
ACP_tdxHandleOfMaterial hVisualMat;
GLI_xCreateMaterial(&hVisualMat);
GMT_fn_vSetVisualMaterial(hGameMaterial,hVisualMat);
}
// Mechanics
ulId=(unsigned long)GMT_fn_hGetMechanicsMaterial(hGameMaterial);
if(ulId!=0)
{
BIN_fn_p_cGetPointer((char*)&hGameMaterial->hMechanicsMaterial,(unsigned long*)&hGameMaterial->hMechanicsMaterial,
DNM_fn_p_stGetLinkTableOfMecMatCharacteristics());
}
else
DNM_fn_vInvalidateMatCharacteristics(&(hGameMaterial->hMechanicsMaterial));
// Collide
ulId=(unsigned long)GMT_fn_hGetCollideMaterial(hGameMaterial);
if(ulId!=0)
{
BIN_fn_p_cGetPointer((char*)&hGameMaterial->hCollideMaterial,(unsigned long*)&hGameMaterial->hCollideMaterial,
&g_stGmtZoneLinkTable);
}
else
GMT_fn_vSetCollideMaterial(hGameMaterial,GMT_C_InvalidCollideMaterial);
// Set initial values
hGameMaterial->p_stInitialValues = GMT_fn_hCreateGameMaterial();
memcpy(hGameMaterial->p_stInitialValues,hGameMaterial,sizeof(struct GMT_tdstGameMaterial_));
hGameMaterial->p_stInitialValues->p_stInitialValues=NULL;
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vReadBinaryBloc
//----------------------------------------------------------------------------
// Methods : Write the binary bloc into a buffer and flush the buffer into a
// file.
//----------------------------------------------------------------------------
// Input : _hGmtMaterial : Handle to the game material to save
// _p_cBuffer : Binarisation buffer
// _szBinaryFileName : Name of the binary file
// Output : The length of the data written
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
unsigned long GMT_fn_ulReadBinaryBloc(char* _p_cLoadedBuffer,unsigned long _ulLoadedBufferSize)
{
GMT_tdxHandleToGameMaterial hNewGameMaterial=NULL;
GEO_M_CPAMalloc(hNewGameMaterial,GMT_tdxHandleToGameMaterial,sizeof(struct GMT_tdstGameMaterial_),E_uwGEONotEnoughtMemory);
memcpy((char*)hNewGameMaterial,_p_cLoadedBuffer,_ulLoadedBufferSize);
GMT_fn_vRestorePointerFromIds((unsigned long)hNewGameMaterial);
return (unsigned long)hNewGameMaterial;
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_ulGetStructureSize
//----------------------------------------------------------------------------
// Methods : return the structure size
//----------------------------------------------------------------------------
// Input :
// Output : the size
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
unsigned long GMT_fn_ulGetStructureSize()
{
return sizeof(GMT_tdstGameMaterial);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vReadAllGameMaterialBinaryBlocs
//----------------------------------------------------------------------------
// Methods : Reads all the game materials from a binary file.
//----------------------------------------------------------------------------
// Input : _szBinaryFileName : Name of the binary file
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vReadAllGameMaterialBinaryBlocs(char* _szBinaryFileName)
{
BIN_fn_vReadDataFromLinkTable(GMT_fn_p_stGetLinkTable(),
GMT_fn_ulReadBinaryBloc,
GMT_fn_ulGetStructureSize(),
_szBinaryFileName);
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_p_cGeneralAllocationFunction
//----------------------------------------------------------------------------
// Methods : Allocate a bloc to read a bloc of game materials
//----------------------------------------------------------------------------
// Input : _ulSize : size to be allocated
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
char* GMT_fn_p_cGeneralAllocationFunction(unsigned long _ulSize)
{
char* p_cbuffer;
MMG_fn_vAddMemoryInfo( MMG_C_lTypeGMT , MMG_C_lSubTypeMain , 0 );
GEO_M_CPAMalloc(p_cbuffer,char*,_ulSize,E_uwGEONotEnoughtMemory);
return p_cbuffer;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vReadAllGameMaterialBinaryBlocs2
//----------------------------------------------------------------------------
// Methods : Reads all the game materials from a binary file.(Version 2).
// With this method, all the gmt are allocated in 1 time
//----------------------------------------------------------------------------
// Input : _szBinaryFileName : Name of the binary file
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vReadAllGameMaterialBinaryBlocs2(char* _szBinaryFileName)
{
BIN_fn_vReadDataFromLinkTableWithoutAllocation(GMT_fn_p_stGetLinkTable(),
GMT_fn_vRestorePointerFromIds,
GMT_fn_ulGetStructureSize(),
_szBinaryFileName,
GMT_fn_p_cGeneralAllocationFunction);
}
*/
/*
BEGIN OS 25.02.98
Callbacks for bin files.
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_hLoadGameMaterial
// Load a game material from the scripts or from the binary bloc
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------*/
/*
GMT_tdxHandleToGameMaterial GMT_fn_hLoadBinGameMaterial(char* _szSectionName)
{
SCR_tdst_Cxt_Values *p_stValues ;
SCR_tdst_Link_Value *p_stLinkValue;
unsigned long ulResult;
p_stLinkValue=BIN_fn_p_stSearchShortKey(GMT_fn_p_stGetLinkTable(),_szSectionName);
if(p_stLinkValue==NULL)
{
p_stValues = SCR_fnp_st_Bin_GetREFERENCE( _szSectionName );
if(p_stValues)
{
ulResult = SCR_M_ul_RdL0_ExtractLongValue(p_stValues,0);
return (GMT_tdxHandleToGameMaterial)ulResult;
}
else
return (GMT_tdxHandleToGameMaterial)GMT_C_ulInvalidHandle;
}
else return (GMT_tdxHandleToGameMaterial)p_stLinkValue->ulValue;
}
*/
/*////////////////////////////////////////////////////////////////////////////
// Description : fn_eScriptCallBackBinGameMaterial
// Reads the script file describing a game material
/////////////////////////////////////////////////////////////////////////////*/
/*
SCR_tde_Anl_ReturnValue fn_eScriptCallBackBinGameMaterial(
SCR_tdst_File_Description *_p_stFile,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction)
{
GMT_tdxHandleToGameMaterial h_GameMaterial;
char chTag;
SCR_tde_Anl_ReturnValue eReturnValue = R_SCRIPT_NormalReturn;
if( eAction != SCR_EA_Anl_BeginSection )
{
// do whatever ...
return SCR_ERV_Anl_NormalReturn;
}
SCR_fn_v_Bin_BeginSection(_p_stFile);
// Allocates
h_GameMaterial = GMT_fn_hCreateGameMaterial();
SCR_M_RdL0_SetSectionLong(0, 0, (unsigned long)(h_GameMaterial))
GMT_fn_vAddEntryIntoLinkTable((unsigned long)h_GameMaterial);
do{
chTag=SCR_fn_ch_Bin_GetCHAR( _p_stFile );
switch (chTag)
{
case 0: //VisualMat
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
ACP_tdxHandleOfMaterial hVisualMat;
char szName[MAX_PATH];
SCR_fn_sz_Bin_GetREFERENCE2Buffer( _p_stFile, szName );
// Call the callback of visual material
// And Put the Handle in the structure GameMaterial Handled
p_stValues = SCR_fnp_st_Bin_GetREFERENCE( szName );;
if(p_stValues)
{
ulResult = p_stValues->a_ulValues[0];
hVisualMat=(ACP_tdxHandleOfMaterial)ulResult;
GMT_fn_vSetVisualMaterial(h_GameMaterial,hVisualMat);
}
}
break;
case 1: //MechanicalMat
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
char szName[MAX_PATH];
SCR_fn_sz_Bin_GetREFERENCE2Buffer( _p_stFile, szName );
// Call the call back for the other properties into the .miv file
// and put the handles into the structure GameMaterial Handled
p_stValues = SCR_fnp_st_Bin_GetREFERENCE( szName );;
if(p_stValues)
{
ulResult = p_stValues->a_ulValues[0];
GMT_fn_vSetMechanicsMaterial(h_GameMaterial,(DNM_tdxHandleToMecMatCharacteristics)ulResult);
}
}
break;
case 2: //CollideMat
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
char szName[MAX_PATH];
SCR_fn_sz_Bin_GetREFERENCE2Buffer( _p_stFile, szName );
// Call the call back for the other properties into the .miv file
// and put the handles into the structure GameMaterial Handled
p_stValues = SCR_fnp_st_Bin_GetREFERENCE( szName );;
if(p_stValues)
{
ulResult = p_stValues->a_ulValues[0];
GMT_fn_vSetCollideMaterial(h_GameMaterial,(GMT_tdxHandleToCollideMaterial)ulResult);
}
}
break;
case 3: //SoundType
{
long lValue;
lValue = SCR_fn_l_Bin_GetLONG( _p_stFile );
GMT_fn_vSetSoundMaterial(h_GameMaterial,lValue);
}
break;
}
}while (chTag!=-1);
h_GameMaterial->p_stInitialValues = GMT_fn_hCreateGameMaterial();
memcpy(h_GameMaterial->p_stInitialValues,h_GameMaterial,sizeof(struct GMT_tdstGameMaterial_));
h_GameMaterial->p_stInitialValues->p_stInitialValues=NULL;
SCR_fn_v_Bin_EndSection(_p_stFile);
return(eReturnValue);
}
*/
/*
END OS 25.02.98
Callbacks for bin files.
*/

View File

@@ -0,0 +1,396 @@
/* (c) Ubi R&D 1997*/
/* See Alain Robin for any comment or question*/
/****************************************************************************/
/* INCLUDES */
/****************************************************************************/
#include "acp_base.h"
#include "cpa_std.h"
#include "MTH.h"
#include "SCR.h"
/*#include "BIN.h"*/
#include "GEO.h"
#include "GmtStruc.h"
#include "GmtFunct.h"
#include "GmtProto.h"
#include "GmtZnLod.h"
#include "GmtLoad.h"
#include "GmtLnkTb.h"
#include "MEC/DNMLdMat.h"
/*---------------------------------------------------------------------------/
// Description : GMT_fn_vAddEntryIntoZoneLinkTable
// Add an entry into the link table of the collide material
------------------------------------------------------------------------------
// Methods : Private function
------------------------------------------------------------------------------
// Input : _ulValue : value of the handle to the created game material
// Output :
------------------------------------------------------------------------------
// Creation date : 01 Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------/*/
void GMT_fn_vAddEntryIntoZoneLinkTable(unsigned long _ulValue)
{
char a255_cLongName[255];
/* char* szSectionName;*/
SCR_M_RdL0_ComputeOpenSectionNameR(0,a255_cLongName);
SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(&g_stGmtZoneLinkTable,
a255_cLongName,
_ulValue),1,
strlen(a255_cLongName)-strlen(SCR_M_RdL0_GetCompleteSectionNameR(0)));
/*
szSectionName=SCR_M_RdL0_GetCompleteSectionNameR(0);
SCR_fnp_st_Link_SetValue(&g_stGmtZoneLinkTable,szSectionName,_ulValue); */
}
/*---------------------------------------------------------------------------/
// Description : fn_eScriptFillCollideMaterial
// Fills in a collide material
------------------------------------------------------------------------------
// Methods : None
------------------------------------------------------------------------------
// Input : Handle to the collide material + script inputs
// Output : scripts output
------------------------------------------------------------------------------
// Creation date : 04 Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------/*/
SCR_tde_Anl_ReturnValue fn_eScriptFillCollideMaterial(
GMT_tdxHandleToCollideMaterial _h_CollideMaterial,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction
)
{
SCRIPT_tdeReturnValue eReturnValue = R_SCRIPT_NormalReturn;
if(!strcmp(szAction,C_EntryCollideMaterial))
{
short wValue;
if(strcmp(d_szPars[0],GMT_C_szZDM)==0)
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDM);
else if(strcmp(d_szPars[0],GMT_C_szZDR)==0)
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDR);
else if(strcmp(d_szPars[0],GMT_C_szZDE)==0)
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDE);
else if(strcmp(d_szPars[0],GMT_C_szZDD)==0)
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDD);
/* else
syntax error */
wValue=(short)atoi(d_szPars[1]);
GMT_fn_hSetCollideMaterialIdentifier(_h_CollideMaterial,wValue);
}
/*else if(!strcmp(szAction,C_Entry?)) */
/*{ */
/* Call The CallBackOf? */
/*} */
else
{
/* Manage the Treatment of an Error */
/* To be Done */
}
return(eReturnValue);
}
/*---------------------------------------------------------------------------/
// Description : fn_eScriptCallBackCollideMaterial
// Reads the script file describing a game material
------------------------------------------------------------------------------
// Methods : None
------------------------------------------------------------------------------
// Input : script input
// Output : script output
------------------------------------------------------------------------------
// Creation date : 04 Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------/*/
SCR_tde_Anl_ReturnValue fn_eScriptCallBackCollideMaterial(
SCR_tdst_File_Description *p_stHandle,
char *szAction,
char *d_szPars[],
SCR_tde_Anl_Action eAction)
{
GMT_tdxHandleToCollideMaterial h_CollideMaterial;
SCRIPT_tdeReturnValue eReturnValue = R_SCRIPT_NormalReturn;
if(eAction==C_SCRIPT_Section)
{
/* If a section is detected */
/* Allocates */
h_CollideMaterial = GMT_fn_hCreateCollideMaterial();
SCR_M_RdL0_SetSectionLong(0, 0, (unsigned long)(h_CollideMaterial))
GMT_fn_vAddEntryIntoZoneLinkTable((unsigned long)h_CollideMaterial);
}
else if(eAction==C_SCRIPT_Entry)
{
/*----------------------------*/
/* Fills the collide material */
/*----------------------------*/
SCR_M_RdL0_GetSectionLong(0, 0, GMT_tdxHandleToCollideMaterial, h_CollideMaterial)
fn_eScriptFillCollideMaterial(
h_CollideMaterial,
szAction,
d_szPars,
eAction);
}
return(eReturnValue);
}
/*---------------------------------------------------------------------------/
// Description : GMT_fn_vInitLoadCollideMaterial
// Loading process initialization
------------------------------------------------------------------------------
// Methods : Register the callback
------------------------------------------------------------------------------
// Input :
// Output :
------------------------------------------------------------------------------
// Creation date : 04 Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author : Alain Robin
---------------------------------------------------------------------------/*/
void GMT_fn_vInitLoadCollideMaterial()
{
SCR_fn_v_RdL0_RegisterCallback(C_SectionCollideMaterial,fn_eScriptCallBackCollideMaterial, SCR_CRC_c_RdL0_ForSection);
SCR_fn_v_Link_InitTable(&g_stGmtZoneLinkTable);
}
/*---------------------------------------------------------------------------/
// Description : GMT_fn_vDeleteEntryWithPriority
------------------------------------------------------------------------------
// Methods :
------------------------------------------------------------------------------
// Input :
// Output :
------------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author : Alain Robin
---------------------------------------------------------------------------/*/
void GMT_fn_vDeleteCMTEntryWithPriority(unsigned char ucPrioMin, unsigned char ucPrioMax)
{
SCR_fn_v_Link_DeleteEntryWithPriority(&g_stGmtZoneLinkTable,ucPrioMin,ucPrioMax);
}
/*---------------------------------------------------------------------------/
// Description : GMT_fn_p_stGetZoneLinkTable
// Get the link table of the collide material module
------------------------------------------------------------------------------
// Methods : Nothing to say
------------------------------------------------------------------------------
// Input :
// Output : A pointer to the static link table
------------------------------------------------------------------------------
// Creation date : 07 Apr 97 Author: Alain Robin
------------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
---------------------------------------------------------------------------/*/
REF_tdstLinkTable* GMT_fn_p_stGetZoneLinkTable()
{
return &g_stGmtZoneLinkTable;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_hLoadCollideMaterial
// Load a collide material from the scripts or from the binary bloc
//----------------------------------------------------------------------------
// Methods : For the moment, use the script
//----------------------------------------------------------------------------
// Input : _szSectionName : Name of the section to load
// Output : A handle to the loaded collide material
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
GMT_tdxHandleToCollideMaterial GMT_fn_hLoadCollideMaterial(char* _szSectionName)
{
SCR_tdst_Cxt_Values *p_stValues ;
SCR_tdst_Link_Value *p_stLinkValue;
unsigned long ulResult;
unsigned int uiPos;
uiPos = 0;
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value, uiPos, p_stLinkValue,SCR_M_st_Link_GetDynamicArray(&g_stGmtZoneLinkTable));
while(p_stLinkValue)
{
if(!strcmpi(SCR_M_p_sz_Link_GetKey(p_stLinkValue) + SCR_M_ul_Link_GetAdditionalLong(p_stLinkValue,1),_szSectionName))
break;
uiPos++;
SCR_M_DyAr_GetNextElement(SCR_tdst_Link_Value, uiPos, p_stLinkValue,SCR_M_st_Link_GetDynamicArray(&g_stGmtZoneLinkTable));
}
/* p_stLinkValue=BIN_fn_p_stSearchShortKey(&g_stGmtZoneLinkTable,_szSectionName);*/
if(p_stLinkValue==NULL)
{
p_stValues = SCR_fnp_st_RdL0_AnalyseSection(_szSectionName,SCR_CDF_uw_Anl_Normal);
if(p_stValues)
{
ulResult = SCR_M_ul_RdL0_ExtractLongValue(p_stValues,0);
return (GMT_tdxHandleToCollideMaterial)ulResult;
}
else
return GMT_C_InvalidCollideMaterial;
}
else
return (GMT_tdxHandleToCollideMaterial)p_stLinkValue->ulValue;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vPrepareSaveBinaryBloc
//----------------------------------------------------------------------------
// Methods : Prepare data for a binary save and call the save structure
// function for all loaded gmt
//----------------------------------------------------------------------------
// Input :
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vPrepareSaveCollideBinaryBloc()
{
BIN_fn_vCreateBinaryIds(&g_stGmtZoneLinkTable,BIN_C_CMTID);
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_ulWriteCMTBinaryBloc
//----------------------------------------------------------------------------
// Methods : Write the binary bloc for the collide material
//----------------------------------------------------------------------------
// Input : _ulStructAdress : Address of the structure to be written
// _p_cDestBuffer : Output buffer
// Output : The length of the data written
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
unsigned long GMT_fn_ulWriteCMTBinaryBloc(unsigned long _ulStructAdress,
char* _p_cDestBuffer)
{
GMT_tdstCollideMaterial *p_stCollideMat;
char* p_cBufferPointer=_p_cDestBuffer;
p_stCollideMat=(GMT_tdstCollideMaterial*)_ulStructAdress;
p_cBufferPointer=BIN_fn_p_cPutShort(p_cBufferPointer,p_stCollideMat->wTypeOfZone);
p_cBufferPointer=BIN_fn_p_cPutShort(p_cBufferPointer,p_stCollideMat->xIdentifier);
return p_cBufferPointer-_p_cDestBuffer;
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vWriteAllCMTBinaryBlocs
//----------------------------------------------------------------------------
// Methods : Write all the binary bloc for the collide material
//----------------------------------------------------------------------------
// Input : _szBinaryFileName
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vWriteAllCMTBinaryBlocs(char* _szBinaryFileName)
{
GMT_fn_vPrepareSaveCollideBinaryBloc();
BIN_fn_vPutBinaryDataIntoFileFromLinkTable(_szBinaryFileName,&g_stGmtZoneLinkTable,
sizeof(GMT_tdstCollideMaterial),GMT_fn_ulWriteCMTBinaryBloc);
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_ulReadBinaryBloc
//----------------------------------------------------------------------------
// Methods : Read a the binary bloc for the collide material
//----------------------------------------------------------------------------
// Input : _p_cLoadedBuffer : Input buffer
// _ulLoadedBufferSize : Size of the loaded buffer
// Output : The address of the allocated bloc
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
unsigned long GMT_fn_ulReadCMTBinaryBloc(char* _p_cLoadedBuffer,unsigned long _ulLoadedBufferSize)
{
GMT_tdxHandleToCollideMaterial hNewCollideMaterial=NULL;
GEO_M_CPAMalloc(hNewCollideMaterial,GMT_tdxHandleToCollideMaterial,sizeof(struct GMT_tdstCollideMaterial_),E_uwGEONotEnoughtMemory);
memcpy((char*)hNewCollideMaterial,_p_cLoadedBuffer,_ulLoadedBufferSize);
return (unsigned long)hNewCollideMaterial;
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vReadAllCMTBinaryBlocs
//----------------------------------------------------------------------------
// Methods : Read all the binary blocs for the collide material
//----------------------------------------------------------------------------
// Input : _szBinaryFileName : The binary file name
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vReadAllCMTBinaryBlocs(char* _szBinaryFileName)
{
BIN_fn_vReadDataFromLinkTable(&g_stGmtZoneLinkTable,GMT_fn_ulReadCMTBinaryBloc,
sizeof(struct GMT_tdstCollideMaterial_), _szBinaryFileName);
}
*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vReadAllCMTBinaryBlocs
//----------------------------------------------------------------------------
// Methods : Read all the binary blocs for the collide material
//----------------------------------------------------------------------------
// Input : _szBinaryFileName : The binary file name
// Output :
//----------------------------------------------------------------------------
// Creation date : Aug 97 Author: Alain Robin
//----------------------------------------------------------------------------
// Modifications :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
/*
void GMT_fn_vReadAllCMTBinaryBlocs2(char* _szBinaryFileName)
{
BIN_fn_vReadDataFromLinkTableWithoutAllocation(&g_stGmtZoneLinkTable,NULL,
sizeof(struct GMT_tdstCollideMaterial_), _szBinaryFileName,
GMT_fn_p_cGeneralAllocationFunction);
}
*/

View File

@@ -0,0 +1,75 @@
#include "ldt.h"
/*****************************************************************
Name:
Description: Create callback for LDT
Author: Mircea Petrescu
Date: 8/25/98
Modified:
*****************************************************************/
int fn_iCreateCollideMaterial( LDT_tdst_Link *pLink )
{
GMT_tdxHandleToCollideMaterial h_CollideMaterial;
h_CollideMaterial = GMT_fn_hCreateCollideMaterial();
pLink->pObject=(void *)h_CollideMaterial;
return 0;
}
/*****************************************************************
Name:
Description: Load callback for LDT
Author: Mircea Petrescu
Date: 8/25/98
Modified:
*****************************************************************/
int fn_iLoadCollideMaterial( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
GMT_tdxHandleToCollideMaterial _h_CollideMaterial=(GMT_tdxHandleToCollideMaterial)pLink->pObject;
char a255_cLongName[255];
int iLen;
iLen=LDT_ComputeSectionName(pLink,a255_cLongName);
SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(&g_stGmtZoneLinkTable,
a255_cLongName,
(unsigned long)_h_CollideMaterial),
1,iLen);
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
short wValue;
char *szEntry=LDT_szGetEntryName();
if( strcmp( szEntry, C_EntryCollideMaterial )!=0 )
break;
szEntry=LDT_szGetParam(1);
switch( *(long *)szEntry )
{
case 'mdZ' : /* Zdm */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDM);
break;
case 'rdZ' : /* Zdr */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDR);
break;
case 'edZ' : /* Zde */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDE);
break;
case 'ddZ' : /* Zdd */
GMT_fn_vSetTypeOfCollideMaterial(_h_CollideMaterial,GMT_C_wZDD);
break;
}
wValue=(short)atoi( LDT_szGetParam( 2 ) );
GMT_fn_hSetCollideMaterialIdentifier(_h_CollideMaterial,wValue);
}
}
}
return 0;
}

View File

@@ -0,0 +1,89 @@
#include "LDT.h"
/*****************************************************************
Name:
Description: Create callback for LDT
Author: Mircea Petrescu
Date: 8/13/98
Modified:
*****************************************************************/
int fn_iCreateGameMaterial( LDT_tdst_Link *pLink )
{
GMT_tdxHandleToGameMaterial h_GameMaterial= GMT_fn_hCreateGameMaterial();
pLink->pObject=(void *)h_GameMaterial;
return 0;
}
/*****************************************************************
Name:
Description: Load callback for LDT
Author: Mircea Petrescu
Date: 8/13/98
Modified:
*****************************************************************/
int fn_iLoadGameMaterial( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
GMT_tdxHandleToGameMaterial h_GameMaterial=(GMT_tdxHandleToGameMaterial)pLink->pObject;
char a255_cLongName[256];
int iLen=LDT_ComputeSectionName(pLink,a255_cLongName);
SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(
&g_stGmtLinkTable, a255_cLongName, (long)h_GameMaterial)
,1 , iLen);
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
switch (*(long*)szEntry)
{
case 'usiV' : /* VisualMat */
{
ACP_tdxHandleOfMaterial hVisualMat;
hVisualMat=(ACP_tdxHandleOfMaterial)LDT_LoadSection( LDT_szGetParam(1) );
GMT_fn_vSetVisualMaterial(h_GameMaterial,hVisualMat);
}
break;
case 'hceM' : /* MechanicalMat */
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
/* Call the call back for the other properties into the .miv file */
/* and put the handles into the structure GameMaterial Handled */
GMT_fn_vSetMechanicsMaterial(h_GameMaterial,(DNM_tdxHandleToMecMatCharacteristics)LDT_LoadSection( LDT_szGetParam(1) ));
}
break;
case 'lloC' : /* CollideMat */
{
/* Call the call back for the other properties into the .miv file */
/* and put the handles into the structure GameMaterial Handled */
GMT_fn_vSetCollideMaterial(h_GameMaterial,(GMT_tdxHandleToCollideMaterial)LDT_LoadSection(LDT_szGetParam(1)));
}
break;
case 'nuoS' : /* SoundType */
{
GMT_fn_vSetSoundMaterial(h_GameMaterial,(long)atoi( LDT_szGetParam( 1 ) ));
}
break;
}
}
break;
}
}
return 0;
}

View File

@@ -0,0 +1,764 @@
/* (c) Ubi R&D 1996*/
/* See Alain Robin for any comment or question*/
/****************************************************************************/
/* INCLUDES */
/****************************************************************************/
#include "acp_base.h"
#include "MTH.h"
#include "GEO.h"
#include "GLI.h"
#define __DeclareGlobalVariableErmGmt_h__
#include "ErmGmt.h"
#include "GmtStruc.h" /* structure definition*/
#include "GmtFunct.h" /* access function definition*/
#include "GmtProto.h" /* complex function definition*/
/****************************************************************************/
/* PRIVATE FUNCTIONS */
/****************************************************************************/
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vRaiseFatalError
// Used to raise a fatal error of the GMT module
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro in ERM
//////////////////////////////////////////////////////////////////////////////
// Input :
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : Mar 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vRaiseFatalError()
{
Erm_M_UpdateLastError(Gmt, C_ucErmDefaultChannel, E_uwGmtFatalError1,
C_lErmNoDebugData, C_ucErmOpenInfoWindow,
C_ucAllowStopForDebug, NULL);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/****************************************************************************/
/* BASIC FUNCTIONS */
/****************************************************************************/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vInitGameMaterialErrorAndMemory
// Used to initialize the memory and error variables
----------------------------------------------------------------------------//
// Methods : None
----------------------------------------------------------------------------//
// Input :
// Output :
----------------------------------------------------------------------------//
// Creation date : May 97 Author: Alain Robin
----------------------------------------------------------------------------//
// Modifications :
// Modification date : Modification author : Alain Robin
----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vInitGameMaterialErrorAndMemory(void)
{
Erm_M_InitErrMsg(Gmt);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_hCreateGameMaterial
// Used to create an empty game material struct
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input :
// Output : Handle to the created game material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Add support for sectors
// Modification date : 22 Jan 97 Modification author : Alain Robin
////////////////////////////////////////////////////////////////////////////
// Modifications : We don't allocate anything anymore for the sub-parts
// Modification date : Apr 97 Modification author : Alain Robin
//////////////////////////////////////////////////////////////////////////// */
GMT_tdxHandleToGameMaterial GMT_fn_hCreateGameMaterial(void)
{
/* return GMT_p_fn_hVirtualCreate ? GMT_p_fn_hVirtualCreate() : NULL;*/
if (GMT_p_fn_hVirtualCreate)
return GMT_p_fn_hVirtualCreate();
else
return NULL;
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vCopyGameMaterial
// Used to copy an existing game material struct
//////////////////////////////////////////////////////////////////////////////
// Methods : Use the "Get" and the "Set" macros to copy the field pointers
//////////////////////////////////////////////////////////////////////////////
// Input : _hSrc : source game material
// Output : _hDst : copied game material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Add support for sector material
// Modification date : 22 Jan 97 Modification author : Alain Robin
////////////////////////////////////////////////////////////////////////////
// Modifications : Add handle validity verification
// Modification date : Mar 97 Modification author : Alain Robin
////////////////////////////////////////////////////////////////////////////
// Modifications : Duplicate visual material when we copy a game material
// Modification date : Apr 97 Modification author : Alain Robin
//////////////////////////////////////////////////////////////////////////// */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vCopyGameMaterial(GMT_tdxHandleToGameMaterial _hDst, GMT_tdxHandleToGameMaterial _hSrc)
{
/* ACP_tdxHandleOfMaterial hVisual,hCopyOfVisual;
#ifdef _DEBUG
if((!GMT_fn_b_ulIsValid(_hDst))||(!GMT_fn_b_ulIsValid(_hSrc)))
GMT_fn_vRaiseFatalError();
#endif*/
/* Duplicate visual material */
/* hVisual=GMT_fn_hGetVisualMaterial(_hSrc);
GLI_xDuplicateMaterial (&hCopyOfVisual,hVisual);
GMT_M_vSetVisualMaterial(_hDst,hCopyOfVisual);
GMT_M_vSetSoundMaterial(_hDst,GMT_M_hGetSoundMaterial(_hSrc));
GMT_M_vSetCollideMaterial(_hDst,GMT_M_hGetCollideMaterial(_hSrc));*/
/* Copy initial values */
/* if(_hSrc->p_stInitialValues!=NULL)
{
if(_hDst->p_stInitialValues==NULL)
{
_hDst->p_stInitialValues=GMT_fn_hCreateGameMaterial();
memcpy(_hDst->p_stInitialValues,_hSrc->p_stInitialValues,sizeof(struct GMT_tdstGameMaterial_));
}
else
{
memcpy(_hDst->p_stInitialValues,_hSrc->p_stInitialValues,sizeof(struct GMT_tdstGameMaterial_));
}
}
#ifdef SECTOR_IN_GMT
GMT_M_vSetSectorMaterial(_hDst,GMT_M_hGetSectorMaterial(_hSrc));
#endif // SECTOR_IN_GMT */
if(GMT_p_fn_vVirtualCopy!=NULL)
GMT_p_fn_vVirtualCopy(_hDst,_hSrc);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vDestroyGameMaterial
// Delete a created game material handle
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : _hOld : game material handle to delete
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vDestroyGameMaterial(GMT_tdxHandleToGameMaterial _hOld)
{
if(GMT_p_fn_vVirtualDestroy!=NULL)
GMT_p_fn_vVirtualDestroy(_hOld);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_b_ulIsValid
// Checks if the handle is valid
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : _hOld : game material handle to delete
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
unsigned long GMT_fn_b_ulIsValid(GMT_tdxHandleToGameMaterial _hMaterial)
{
/*XB*/
#ifdef CHECK_POINTER
return (_hMaterial!=(GMT_tdxHandleToGameMaterial)GMT_C_ulInvalidHandle)&&
(_hMaterial!=NULL)&&(((unsigned long)_hMaterial & 0xFF000000) == 0x80000000);
#else /* CHECK_POINTER */
return (_hMaterial!=(GMT_tdxHandleToGameMaterial)GMT_C_ulInvalidHandle)&&(_hMaterial!=NULL);
#endif /* CHECK_POINTER */
/*End XB*/
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vInvalidate
// Invalidate an handle
//////////////////////////////////////////////////////////////////////////////
// Methods : None
//////////////////////////////////////////////////////////////////////////////
// Input : _p_hOld : game material handle to invalidate
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : Mar 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
void GMT_fn_vInvalidate(GMT_tdxHandleToGameMaterial* _p_hOld)
{
*_p_hOld = (GMT_tdxHandleToGameMaterial)GMT_C_ulInvalidHandle;
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/****************************************************************************/
/* ACCESSORS */
/****************************************************************************/
/*Friend module access with macros*/
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_hGetVisualMaterial
// Used to get the visual part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output : Handle to the visual material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Add handle validity test
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
ACP_tdxHandleOfMaterial GMT_fn_hGetVisualMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
return GMT_M_hGetVisualMaterial(_hGameMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetVisualMaterial
// Used to set the visual part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _hVisualMat : Handle to the visual meterial
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Add verification of the validity of the handle
// Modification date : Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vSetVisualMaterial(GMT_tdxHandleToGameMaterial _hGameMat, ACP_tdxHandleOfMaterial _hVisualMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
GMT_M_vSetVisualMaterial(_hGameMat,_hVisualMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_hGetMechanicsMaterial
// Used to get the mechanics part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output : Handle to the mechanics material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Add the handle validity verification
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
DNM_tdxHandleToMecMatCharacteristics GMT_fn_hGetMechanicsMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
return GMT_M_hGetMechanicsMaterial(_hGameMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetMechanicsMaterial
// Used to set the mechanics part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _hMechanicsMat : Handle to the mechanics characteristics
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vSetMechanicsMaterial(GMT_tdxHandleToGameMaterial _hGameMat, DNM_tdxHandleToMecMatCharacteristics _hMechanicsMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
GMT_M_vSetMechanicsMaterial(_hGameMat,_hMechanicsMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_hGetSoundMaterial
// Used to set the sound characteristics of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output : the sound material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
SND_tdxHandleToSoundMaterial GMT_fn_hGetSoundMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
return GMT_M_hGetSoundMaterial(_hGameMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetSoundMaterial
// Used to set the sound part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _hMechanicsMat : Handle to the mechanics characteristics
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vSetSoundMaterial(GMT_tdxHandleToGameMaterial _hGameMat, SND_tdxHandleToSoundMaterial _hSoundMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
GMT_M_vSetSoundMaterial(_hGameMat,_hSoundMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_hGetCollideMaterial
// Used to set the collision characteristics of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output : the collide material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : March 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
GMT_tdxHandleToCollideMaterial GMT_fn_hGetCollideMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
return GMT_M_hGetCollideMaterial(_hGameMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetCollideMaterial
// Used to set the collision part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _hCollideMat : Handle to the collide material
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 14 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vSetCollideMaterial(GMT_tdxHandleToGameMaterial _hGameMat, GMT_tdxHandleToCollideMaterial _hCollideMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
GMT_M_vSetCollideMaterial(_hGameMat,_hCollideMat);
}
#ifdef SECTOR_IN_GMT
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_hGetSectorMaterial
// Used to set the sector characteristics of the material (handle to the next
// sector)
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output : the sector material
//////////////////////////////////////////////////////////////////////////////
// Creation date : 22 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
HIE_tdxHandleToSuperObject GMT_fn_hGetSectorMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
return GMT_M_hGetSectorMaterial(_hGameMat);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetSectorMaterial
// Used to set the sector part of the material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use corresponding macro
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _hCollideMat : Handle to the collide material
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : 22 Jan 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications : Check the handle validity
// Modification date : Mar 97 Modification author : A.R.
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vSetSectorMaterial(GMT_tdxHandleToGameMaterial _hGameMat, HIE_tdxHandleToSuperObject _hSectorMat)
{
#ifdef _DEBUG
if(!GMT_fn_b_ulIsValid(_hGameMat))
GMT_fn_vRaiseFatalError();
#endif
GMT_M_vSetSectorMaterial(_hGameMat,_hSectorMat);
}
#endif /* SECTOR_IN_GMT*/
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vReInitializeGameMaterial
// Restore loaded values for GMT structure
//////////////////////////////////////////////////////////////////////////////
// Methods : Use the member pointer
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : May 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/*void GMT_fn_vReInitializeGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
GMT_tdxHandleToGameMaterial hInitialGameMat;
hInitialGameMat=(GMT_tdxHandleToGameMaterial)(_hGameMat->p_stInitialValues);
if(hInitialGameMat!=NULL)
{
GMT_fn_vSetCollideMaterial(_hGameMat,GMT_fn_hGetCollideMaterial(hInitialGameMat));
GMT_fn_vSetMechanicsMaterial(_hGameMat,GMT_fn_hGetMechanicsMaterial(hInitialGameMat));
GMT_fn_vSetSoundMaterial(_hGameMat,GMT_fn_hGetSoundMaterial(hInitialGameMat));
GMT_fn_vSetVisualMaterial(_hGameMat,GMT_fn_hGetVisualMaterial(hInitialGameMat));
}
}
*/
/*END fbolefeysot}*/
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetGameMaterialInitialValues
// put current values into initial values of the game material
//////////////////////////////////////////////////////////////////////////////
// Methods : Use the member pointer
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : October 97 Author: Benoit Germain
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/*
void GMT_fn_vSetGameMaterialInitialValues(GMT_tdxHandleToGameMaterial _hGameMat)
{
if ( GMT_fn_b_ulIsValid(_hGameMat) )
{
//remember the pointer on the initial game material
GMT_tdxHandleToGameMaterial hInitialGameMat = _hGameMat->p_stInitialValues;
// if not valid, create some
if ( !GMT_fn_b_ulIsValid(hInitialGameMat) )
_hGameMat->p_stInitialValues = hInitialGameMat = GMT_fn_hCreateGameMaterial();
//copy the initial values into the game material
memcpy(hInitialGameMat,_hGameMat,sizeof(struct GMT_tdstGameMaterial_));
//but do not forget to clear the pointer on the initial values' initial values
hInitialGameMat->p_stInitialValues = NULL;
}
}
*/
/*END fbolefeysot}*/
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vSetCollideIdentifierTypeOfGameMaterial
// Set the collide type for the identifier to 1
//////////////////////////////////////////////////////////////////////////////
// Methods : Use accessors and functions of Collide Material
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _uwType : Type to set into the identifier (0 to 15)
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : May 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vSetCollideIdentifierTypeOfGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
unsigned short _uwType)
{
GMT_tdxHandleToCollideMaterial hCollideMat;
hCollideMat=GMT_fn_hGetCollideMaterial(_hGameMat);
GMT_fn_vSetCollideMaterialTypeOfIdentifier(hCollideMat,_uwType);
}
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_vResetCollideIdentifierTypeOfGameMaterial
// Set the collide type for the identifier to 0
//////////////////////////////////////////////////////////////////////////////
// Methods : Use accessors and functions of Collide Material
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _uwType : Type to set into the identifier (0 to 15)
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : May 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
void GMT_fn_vResetCollideIdentifierTypeOfGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
unsigned short _uwType)
{
GMT_tdxHandleToCollideMaterial hCollideMat;
hCollideMat=GMT_fn_hGetCollideMaterial(_hGameMat);
GMT_fn_vResetCollideMaterialTypeOfIdentifier(hCollideMat,_uwType);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
/* ////////////////////////////////////////////////////////////////////////////
// Description : GMT_fn_xTestCollideIdentifierTypeOfGameMaterial
// Test the collide type for the identifier
//////////////////////////////////////////////////////////////////////////////
// Methods : Use accessors and functions of Collide Material
//////////////////////////////////////////////////////////////////////////////
// Input : _hGameMat : Handle to the game material
// _uwType : Type to test into the identifier (0 to 15)
// Output :
//////////////////////////////////////////////////////////////////////////////
// Creation date : May 97 Author: Alain Robin
//////////////////////////////////////////////////////////////////////////////
// Modifications :
// Modification date : Modification author :
//////////////////////////////////////////////////////////////////////////// */
ACP_tdxBool GMT_fn_xTestCollideIdentifierTypeOfGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
unsigned short _uwType)
{
GMT_tdxHandleToCollideMaterial hCollideMat;
hCollideMat=GMT_fn_hGetCollideMaterial(_hGameMat);
if (hCollideMat == (GMT_tdxHandleToCollideMaterial)GMT_C_InvalidCollideMaterial) return FALSE;
return GMT_fn_xTestCollideMaterialTypeOfIdentifier(hCollideMat,_uwType);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_xMultipleTestCollideIdentifierFromGameMaterial
// Test the collide type for the identifier (test several bits in one operation)
------------------------------------------------------------------------------
// Method : Logical operation
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// _xType : Mask containing the bits to test
// Output : TRUE if all the bits set in _xType are present into the collide material
// identifier, FALSE else
------------------------------------------------------------------------------
// Creation date : May 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
ACP_tdxBool GMT_fn_xMultipleTestCollideIdentifierFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
GMT_tdxMask _xType)
{
GMT_tdxHandleToCollideMaterial hCollideMat;
if (_xType == 0)
return TRUE;
hCollideMat=GMT_fn_hGetCollideMaterial(_hGameMat);
if( !hCollideMat || hCollideMat==GMT_C_InvalidCollideMaterial )
return FALSE;
return GMT_fn_xMultipleTestCollideIdentifier(hCollideMat,_xType);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_xGetOneTextureFromGameMaterial
// Get one of the texture composing the animated texture
------------------------------------------------------------------------------
// Method : Nothing to say
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// _llNumberOfAnimatedTexture : Number of the texture into the texture list
// Output : The handle to the texture
------------------------------------------------------------------------------
// Creation date : Nov 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
ACP_tdxHandleOfTexture GMT_fn_xGetOneTextureFromGameMaterialAndLockIt(GMT_tdxHandleToGameMaterial _hGameMat,
long _llNumberOfAnimatedTexture)
{
ACP_tdxHandleOfMaterial hVisualMat;
ACP_tdxHandleOfTexture hTexture;
float fDisplayTime;
hVisualMat=GMT_fn_hGetVisualMaterial(_hGameMat);
GLI_vLockAnimatedTexture(hVisualMat);
GLI_vGetMaterialAnimatedTexture(hVisualMat,_llNumberOfAnimatedTexture,&hTexture,&fDisplayTime);
return hTexture;
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vUnLockTextureFromGameMaterial
// Unlock the animated texture (locked with GMT_fn_xGetOneTextureFromGameMaterialAndLockIt)
------------------------------------------------------------------------------
// Method : Nothing to say
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
------------------------------------------------------------------------------
// Creation date : Nov 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vUnLockTextureFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
ACP_tdxHandleOfMaterial hVisualMat;
hVisualMat=GMT_fn_hGetVisualMaterial(_hGameMat);
GLI_vUnLockAnimatedTexture(hVisualMat);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_lGetNumberOfAnimatedTexturesFromGameMaterial
------------------------------------------------------------------------------
// Method : Nothing to say
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
------------------------------------------------------------------------------
// Creation date : Nov 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
long GMT_fn_lGetNumberOfAnimatedTexturesFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
ACP_tdxHandleOfMaterial hVisualMat;
hVisualMat=GMT_fn_hGetVisualMaterial(_hGameMat);
return GLI_lGetMaterialNumberOfAnimatedTexture(hVisualMat);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetCurrentFrameOfAnimatedTexturesFromGameMaterial
------------------------------------------------------------------------------
// Method : Nothing to say
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
------------------------------------------------------------------------------
// Creation date : Nov 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
void GMT_fn_vSetCurrentFrameOfAnimatedTexturesFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat, long _lTextureNumber)
{
ACP_tdxHandleOfMaterial hVisualMat;
hVisualMat=GMT_fn_hGetVisualMaterial(_hGameMat);
GLI_vSetCurrentAnimatedTextureNumber(hVisualMat,_lTextureNumber);
}
/*----------------------------------------------------------------------------
// Description : GMT_fn_lGetCurrentFrameOfAnimatedTexturesFromGameMaterial
------------------------------------------------------------------------------
// Method : Nothing to say
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
------------------------------------------------------------------------------
// Creation date : Nov 97 Author : Alain Robin
------------------------------------------------------------------------------
// Modification :
// Modification date : Modification author :
----------------------------------------------------------------------------*/
long GMT_fn_lGetCurrentFrameOfAnimatedTexturesFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat)
{
ACP_tdxHandleOfMaterial hVisualMat;
hVisualMat=GMT_fn_hGetVisualMaterial(_hGameMat);
return GLI_lGetCurrentAnimatedTextureNumber(hVisualMat);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */

View File

@@ -0,0 +1,89 @@
#include "LDT.h"
/*****************************************************************
Name:
Description: Create callback for LDT
Author: Mircea Petrescu
Date: 8/13/98
Modified:
*****************************************************************/
int fn_iCreateGameMaterial( LDT_tdst_Link *pLink )
{
GMT_tdxHandleToGameMaterial h_GameMaterial= GMT_fn_hCreateGameMaterial();
pLink->pObject=(void *)h_GameMaterial;
return 0;
}
/*****************************************************************
Name:
Description: Load callback for LDT
Author: Mircea Petrescu
Date: 8/13/98
Modified:
*****************************************************************/
int fn_iLoadGameMaterial( LDT_tdst_Link *pLink )
{
LDT_tdeParseResult result=ParseResult_BeginSection;
GMT_tdxHandleToGameMaterial h_GameMaterial=(GMT_tdxHandleToGameMaterial)pLink->pObject;
char a255_cLongName[256];
int iLen=LDT_ComputeSectionName(pLink,a255_cLongName);
SCR_M_v_Link_SetAdditionalLong(SCR_fnp_st_Link_SetValue(
&g_stGmtLinkTable, a255_cLongName, (long)h_GameMaterial)
,1 , iLen);
while( result!=ParseResult_EndSection )
{
result=LDT_GetNextEntry();
switch( result )
{
case ParseResult_Entry: /* an entry */
{
char *szEntry=LDT_szGetEntryName();
switch (*(long*)szEntry)
{
case 'usiV' : /* VisualMat */
{
ACP_tdxHandleOfMaterial hVisualMat;
hVisualMat=(ACP_tdxHandleOfMaterial)LDT_LoadSection( LDT_szGetParam(1) );
GMT_fn_vSetVisualMaterial(h_GameMaterial,hVisualMat);
}
break;
case 'hceM' : /* MechanicalMat */
{
SCR_tdst_Cxt_Values *p_stValues ;
unsigned long ulResult;
/* Call the call back for the other properties into the .miv file */
/* and put the handles into the structure GameMaterial Handled */
GMT_fn_vSetMechanicsMaterial(h_GameMaterial,(DNM_tdxHandleToMecMatCharacteristics)LDT_LoadSection( LDT_szGetParam(1) ));
}
break;
case 'lloC' : /* CollideMat */
{
/* Call the call back for the other properties into the .miv file */
/* and put the handles into the structure GameMaterial Handled */
GMT_fn_vSetCollideMaterial(h_GameMaterial,(GMT_tdxHandleToCollideMaterial)LDT_LoadSection(LDT_szGetParam(1)));
}
break;
case 'nuoS' : /* SoundType */
{
GMT_fn_vSetSoundMaterial(h_GameMaterial,(long)atoi( LDT_szGetParam( 1 ) ));
}
break;
}
}
break;
}
}
return 0;
}

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[GMT.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project