OpenClonk
C4Material.h File Reference
#include "config/C4Constants.h"
#include "graphics/C4Facet.h"
#include "graphics/CSurface8.h"
#include "object/C4Id.h"
#include "object/C4Shape.h"
Include dependency graph for C4Material.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  C4MaterialReaction
 
class  C4MaterialCore
 
class  C4Material
 
class  C4MaterialMap
 

Macros

#define C4MatOv_Default   0
 
#define C4MatOv_Exact   1
 
#define C4MatOv_None   2
 
#define C4MatOv_HugeZoom   4
 

Typedefs

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)
 

Enumerations

enum  MaterialInteractionEvent { meePXSPos =0 , meePXSMove =1 , meeMassMove =2 }
 
enum  C4MaterialCoreShape {
  C4M_Flat = 0 , C4M_TopFlat = 1 , C4M_Smooth = 2 , C4M_Rough = 3 ,
  C4M_Octagon = 4 , C4M_Smoother = 5
}
 

Functions

bool MatValid (int32_t mat)
 
bool MatVehicle (int32_t iMat)
 
bool IsMCVehicle (BYTE mat)
 
bool IsMCHalfVehicle (BYTE mat)
 
bool IsSomeVehicle (BYTE mat)
 
BYTE MatTex2PixCol (int32_t tex)
 
BYTE Mat2PixColDefault (int32_t mat)
 
int32_t MatDensity (int32_t mat)
 
int32_t MatPlacement (int32_t mat)
 
int32_t MatDigFree (int32_t mat)
 

Variables

C4MaterialMap MaterialMap
 
int32_t MVehic
 
int32_t MTunnel
 
int32_t MWater
 
int32_t MEarth
 
BYTE MCVehic
 
BYTE MCHalfVehic
 

Macro Definition Documentation

◆ C4MatOv_Default

#define C4MatOv_Default   0

Definition at line 29 of file C4Material.h.

◆ C4MatOv_Exact

#define C4MatOv_Exact   1

Definition at line 30 of file C4Material.h.

◆ C4MatOv_HugeZoom

#define C4MatOv_HugeZoom   4

Definition at line 32 of file C4Material.h.

◆ C4MatOv_None

#define C4MatOv_None   2

Definition at line 31 of file C4Material.h.

Typedef Documentation

◆ C4MaterialReactionFunc

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)

Definition at line 41 of file C4Material.h.

Enumeration Type Documentation

◆ C4MaterialCoreShape

Enumerator
C4M_Flat 
C4M_TopFlat 
C4M_Smooth 
C4M_Rough 
C4M_Octagon 
C4M_Smoother 

Definition at line 71 of file C4Material.h.

72 {
73  C4M_Flat = 0,
74  C4M_TopFlat = 1,
75  C4M_Smooth = 2,
76  C4M_Rough = 3,
77  C4M_Octagon = 4,
78  C4M_Smoother= 5,
79 };
@ C4M_Smooth
Definition: C4Material.h:75
@ C4M_Octagon
Definition: C4Material.h:77
@ C4M_TopFlat
Definition: C4Material.h:74
@ C4M_Rough
Definition: C4Material.h:76
@ C4M_Smoother
Definition: C4Material.h:78
@ C4M_Flat
Definition: C4Material.h:73

◆ MaterialInteractionEvent

Enumerator
meePXSPos 
meePXSMove 
meeMassMove 

Definition at line 34 of file C4Material.h.

35 {
36  meePXSPos=0, // PXS check before movement
37  meePXSMove=1, // PXS movement
38  meeMassMove=2 // MassMover-movement
39 };
@ meePXSPos
Definition: C4Material.h:36
@ meeMassMove
Definition: C4Material.h:38
@ meePXSMove
Definition: C4Material.h:37

Function Documentation

◆ IsMCHalfVehicle()

bool IsMCHalfVehicle ( BYTE  mat)
inline

Definition at line 223 of file C4Material.h.

223  {
224  return mat == MCHalfVehic;
225 }
BYTE MCHalfVehic
Definition: C4Material.cpp:38

References MCHalfVehic.

Referenced by IsSomeVehicle().

Here is the caller graph for this function:

◆ IsMCVehicle()

bool IsMCVehicle ( BYTE  mat)
inline

Definition at line 220 of file C4Material.h.

220  {
221  return mat == MCVehic;
222 }
BYTE MCVehic
Definition: C4Material.cpp:37

References MCVehic.

Referenced by IsSomeVehicle().

Here is the caller graph for this function:

◆ IsSomeVehicle()

bool IsSomeVehicle ( BYTE  mat)
inline

Definition at line 226 of file C4Material.h.

226  {
227  return IsMCVehicle(mat) || IsMCHalfVehicle(mat);
228 }
bool IsMCHalfVehicle(BYTE mat)
Definition: C4Material.h:223
bool IsMCVehicle(BYTE mat)
Definition: C4Material.h:220

References IsMCHalfVehicle(), and IsMCVehicle().

Referenced by C4SolidMask::DensityProvider::GetDensity(), C4SolidMask::Put(), C4SolidMask::PutTemporary(), C4SolidMask::Remove(), C4SolidMask::RemoveTemporary(), and C4SolidMask::Repair().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Mat2PixColDefault()

BYTE Mat2PixColDefault ( int32_t  mat)
inline

Definition at line 235 of file C4Material.h.

236 {
238 }
C4MaterialMap MaterialMap
Definition: C4Material.cpp:974
int32_t DefaultMatTex
Definition: C4Material.h:155
C4Material * Map
Definition: C4Material.h:169

References C4Material::DefaultMatTex, C4MaterialMap::Map, and MaterialMap.

Referenced by C4MaterialMap::CrossMapMaterials(), C4TextureMap::DefaultBkgMatTex(), C4PXSSystem::Draw(), C4Landscape::DrawMaterialRect(), C4MCOverlay::Evaluate(), and C4Landscape::InsertDeadMaterial().

Here is the caller graph for this function:

◆ MatDensity()

int32_t MatDensity ( int32_t  mat)
inline

Definition at line 240 of file C4Material.h.

241 {
242  if (!MatValid(mat)) return 0;
244 }
bool MatValid(int32_t mat)
Definition: C4Material.h:210
int32_t Density
Definition: C4Material.h:92

References C4MaterialCore::Density, C4MaterialMap::Map, MaterialMap, and MatValid().

Referenced by C4MaterialMap::CrossMapMaterials(), C4Landscape::DrawMaterialRect(), FindTunnelHeight(), C4Landscape::P::GetBridgeMatConversion(), C4Landscape::InsertDeadMaterial(), C4Landscape::InsertMaterial(), and C4Landscape::UpdatePixMaps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatDigFree()

int32_t MatDigFree ( int32_t  mat)
inline

Definition at line 252 of file C4Material.h.

253 {
254  if (!MatValid(mat)) return 1;
256 }
int32_t DigFree
Definition: C4Material.h:94

References C4MaterialCore::DigFree, C4MaterialMap::Map, MaterialMap, and MatValid().

Here is the call graph for this function:

◆ MatPlacement()

int32_t MatPlacement ( int32_t  mat)
inline

Definition at line 246 of file C4Material.h.

247 {
248  if (!MatValid(mat)) return 0;
250 }
int32_t Placement
Definition: C4Material.h:112

References C4MaterialMap::Map, MaterialMap, MatValid(), and C4MaterialCore::Placement.

Here is the call graph for this function:

◆ MatTex2PixCol()

BYTE MatTex2PixCol ( int32_t  tex)
inline

Definition at line 230 of file C4Material.h.

231 {
232  return BYTE(tex);
233 }
uint8_t BYTE

Referenced by C4Landscape::P::BlastFreePix(), C4Landscape::P::DoScan(), C4Landscape::DrawPolygon(), and C4Landscape::P::Mat2Pal().

Here is the caller graph for this function:

◆ MatValid()

◆ MatVehicle()

bool MatVehicle ( int32_t  iMat)
inline

Definition at line 215 of file C4Material.h.

216 {
217  return iMat == MVehic;
218 }
int32_t MVehic
Definition: C4Material.cpp:36

References MVehic.

Referenced by C4Landscape::RaiseTerrain().

Here is the caller graph for this function:

Variable Documentation

◆ MaterialMap

◆ MCHalfVehic

BYTE MCHalfVehic
extern

◆ MCVehic

◆ MEarth

int32_t MEarth

Definition at line 206 of file C4Material.h.

◆ MTunnel

int32_t MTunnel

Definition at line 206 of file C4Material.h.

◆ MVehic

◆ MWater

int32_t MWater

Definition at line 206 of file C4Material.h.