OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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

#define C4MatOv_Default   0

Definition at line 29 of file C4Material.h.

#define C4MatOv_Exact   1

Definition at line 30 of file C4Material.h.

Referenced by C4TexMapEntry::Init().

#define C4MatOv_HugeZoom   4

Definition at line 32 of file C4Material.h.

Referenced by C4TexMapEntry::Init().

#define C4MatOv_None   2

Definition at line 31 of file C4Material.h.

Referenced by C4MaterialMap::CrossMapMaterials().

Typedef Documentation

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

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 };
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 };

Function Documentation

bool IsMCHalfVehicle ( BYTE  mat)
inline

Definition at line 223 of file C4Material.h.

References MCHalfVehic.

Referenced by IsSomeVehicle().

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

Here is the caller graph for this function:

bool IsMCVehicle ( BYTE  mat)
inline

Definition at line 220 of file C4Material.h.

References MCVehic.

Referenced by IsSomeVehicle().

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

Here is the caller graph for this function:

bool IsSomeVehicle ( BYTE  mat)
inline

Definition at line 226 of file C4Material.h.

References IsMCHalfVehicle(), and IsMCVehicle().

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

BYTE Mat2PixColDefault ( int32_t  mat)
inline

Definition at line 235 of file C4Material.h.

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

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

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

Here is the caller graph for this function:

int32_t MatDensity ( int32_t  mat)
inline

Definition at line 240 of file C4Material.h.

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().

241 {
242  if (!MatValid(mat)) return 0;
244 }
C4Material * Map
Definition: C4Material.h:169
int32_t Density
Definition: C4Material.h:92
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool MatValid(int32_t mat)
Definition: C4Material.h:210

Here is the call graph for this function:

Here is the caller graph for this function:

int32_t MatDigFree ( int32_t  mat)
inline

Definition at line 252 of file C4Material.h.

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

253 {
254  if (!MatValid(mat)) return 1;
256 }
C4Material * Map
Definition: C4Material.h:169
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool MatValid(int32_t mat)
Definition: C4Material.h:210
int32_t DigFree
Definition: C4Material.h:94

Here is the call graph for this function:

int32_t MatPlacement ( int32_t  mat)
inline

Definition at line 246 of file C4Material.h.

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

247 {
248  if (!MatValid(mat)) return 0;
250 }
C4Material * Map
Definition: C4Material.h:169
int32_t Placement
Definition: C4Material.h:112
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool MatValid(int32_t mat)
Definition: C4Material.h:210

Here is the call graph for this function:

BYTE MatTex2PixCol ( int32_t  tex)
inline

Definition at line 230 of file C4Material.h.

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

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

Here is the caller graph for this function:

bool MatVehicle ( int32_t  iMat)
inline

Definition at line 215 of file C4Material.h.

References MVehic.

Referenced by C4Landscape::RaiseTerrain().

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

Here is the caller graph for this function:

Variable Documentation

BYTE MCHalfVehic
int32_t MEarth

Definition at line 36 of file C4Material.cpp.

Referenced by C4MaterialMap::CrossMapMaterials(), and C4Game::PlaceInEarth().

int32_t MWater

Definition at line 36 of file C4Material.cpp.

Referenced by C4MaterialMap::CrossMapMaterials(), and C4Object::ExecLife().