20 #ifndef INC_C4Material
21 #define INC_C4Material
29 #define C4MatOv_Default 0
30 #define C4MatOv_Exact 1
31 #define C4MatOv_None 2
32 #define C4MatOv_HugeZoom 4
41 typedef bool (*
C4MaterialReactionFunc)(
struct C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
45 static inline bool NoReaction(
struct C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged) {
return false; }
141 bool Load(
C4Group &hGroup,
const char *szEntryName);
176 static bool mrfConvert(
C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
177 static bool mrfPoof (
C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
178 static bool mrfCorrode(
C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
179 static bool mrfIncinerate(
C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
180 static bool mrfInsert (
C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
182 static bool mrfScript(
C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY,
C4Real &fXDir,
C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat,
MaterialInteractionEvent evEvent,
bool *pfPosChanged);
188 int32_t
Get(
const char *szMaterial);
193 assert(
ppReactionMap); assert(Inside<int32_t>(iPXSMat,-1,
Num-1)); assert(Inside<int32_t>(iLandscapeMat,-1,
Num-1));
int32_t MatPlacement(int32_t mat)
bool IsMCHalfVehicle(BYTE mat)
BYTE MatTex2PixCol(int32_t tex)
bool MatValid(int32_t mat)
bool MatVehicle(int32_t iMat)
BYTE Mat2PixColDefault(int32_t mat)
bool IsMCVehicle(BYTE mat)
C4MaterialMap MaterialMap
bool(* C4MaterialReactionFunc)(struct C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
int32_t MatDigFree(int32_t mat)
int32_t MatDensity(int32_t mat)
bool IsSomeVehicle(BYTE mat)
StdCopyStrBuf sBelowTempConvertTo
StdCopyStrBuf sBlastShiftTo
C4MaterialCoreShape MapChunkType
int32_t Blast2ObjectRatio
void CompileFunc(StdCompiler *pComp)
std::vector< C4MaterialReaction > CustomReactionList
StdCopyStrBuf sAboveTempConvertTo
int32_t InMatConvertDepth
StdCopyStrBuf sTextureOverlay
int32_t AboveTempConvertDir
bool Load(C4Group &hGroup, const char *szEntryName)
StdCopyStrBuf sInMatConvert
int32_t Dig2ObjectCollect
StdCopyStrBuf sInMatConvertTo
int32_t BelowTempConvertDir
void UpdateScriptPointers()
int32_t AboveTempConvertTo
int32_t BelowTempConvertTo
C4MaterialReaction DefReactConvert
bool SaveEnumeration(C4Group &hGroup)
C4MaterialReaction DefReactPoof
C4MaterialReaction DefReactIncinerate
bool HasMaterials(C4Group &hGroup) const
static bool mrfPoof(C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
C4MaterialReaction * GetReactionUnsafe(int32_t iPXSMat, int32_t iLandscapeMat)
static bool mrfScript(C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
bool SortEnumeration(int32_t iMat, const char *szMatName)
C4MaterialReaction * GetReaction(int32_t iPXSMat, int32_t iLandscapeMat)
void SetMatReaction(int32_t iPXSMat, int32_t iLSMat, C4MaterialReaction *pReact)
static bool mrfConvert(C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
void UpdateScriptPointers()
static bool mrfInsert(C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
bool LoadEnumeration(C4Group &hGroup)
static bool mrfIncinerate(C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
C4MaterialReaction DefReactInsert
C4MaterialReaction ** ppReactionMap
int32_t Get(const char *szMaterial)
C4MaterialReaction DefReactCorrode
int32_t Load(C4Group &hGroup)
bool CrossMapMaterials(const char *szEarthMaterial)
static bool mrfCorrode(C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
static bool NoReaction(struct C4MaterialReaction *pReaction, int32_t &iX, int32_t &iY, int32_t iLSPosX, int32_t iLSPosY, C4Real &fXDir, C4Real &fYDir, int32_t &iPxsMat, int32_t iLsMat, MaterialInteractionEvent evEvent, bool *pfPosChanged)
C4MaterialReaction(C4MaterialReactionFunc pFunc)
C4MaterialReactionFunc pFunc
StdCopyStrBuf sConvertMat
void CompileFunc(StdCompiler *pComp)
void ResolveScriptFuncs(const char *szMatName)
bool operator==(const C4MaterialReaction &rCmp) const