OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Material.h File Reference
#include "config/C4Constants.h"
#include "lib/C4Real.h"
#include "object/C4Id.h"
#include "object/C4Shape.h"
#include "graphics/C4Facet.h"
#include "graphics/CSurface8.h"
#include <vector>
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 31 of file C4Material.h.

#define C4MatOv_Exact   1

Definition at line 32 of file C4Material.h.

Referenced by C4TexMapEntry::Init().

#define C4MatOv_HugeZoom   4

Definition at line 34 of file C4Material.h.

Referenced by C4TexMapEntry::Init().

#define C4MatOv_None   2

Definition at line 33 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 43 of file C4Material.h.

Enumeration Type Documentation

Enumerator
C4M_Flat 
C4M_TopFlat 
C4M_Smooth 
C4M_Rough 
C4M_Octagon 
C4M_Smoother 

Definition at line 73 of file C4Material.h.

74 {
75  C4M_Flat = 0,
76  C4M_TopFlat = 1,
77  C4M_Smooth = 2,
78  C4M_Rough = 3,
79  C4M_Octagon = 4,
80  C4M_Smoother= 5,
81 };
Enumerator
meePXSPos 
meePXSMove 
meeMassMove 

Definition at line 36 of file C4Material.h.

37 {
38  meePXSPos=0, // PXS check before movement
39  meePXSMove=1, // PXS movement
40  meeMassMove=2 // MassMover-movement
41 };

Function Documentation

bool IsMCHalfVehicle ( BYTE  mat)
inline

Definition at line 225 of file C4Material.h.

References MCHalfVehic.

Referenced by IsSomeVehicle().

225  {
226  return mat == MCHalfVehic;
227 }
BYTE MCHalfVehic
Definition: C4Material.cpp:39

Here is the caller graph for this function:

bool IsMCVehicle ( BYTE  mat)
inline

Definition at line 222 of file C4Material.h.

References MCVehic.

Referenced by IsSomeVehicle().

222  {
223  return mat == MCVehic;
224 }
BYTE MCVehic
Definition: C4Material.cpp:38

Here is the caller graph for this function:

bool IsSomeVehicle ( BYTE  mat)
inline

Definition at line 228 of file C4Material.h.

References IsMCHalfVehicle(), and IsMCVehicle().

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

228  {
229  return IsMCVehicle(mat) || IsMCHalfVehicle(mat);
230 }
bool IsMCHalfVehicle(BYTE mat)
Definition: C4Material.h:225
bool IsMCVehicle(BYTE mat)
Definition: C4Material.h:222

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

238 {
240 }
int32_t DefaultMatTex
Definition: C4Material.h:157
C4Material * Map
Definition: C4Material.h:171
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970

Here is the caller graph for this function:

int32_t MatDensity ( int32_t  mat)
inline

Definition at line 242 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().

243 {
244  if (!MatValid(mat)) return 0;
246 }
C4Material * Map
Definition: C4Material.h:171
int32_t Density
Definition: C4Material.h:94
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool MatValid(int32_t mat)
Definition: C4Material.h:212

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 254 of file C4Material.h.

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

255 {
256  if (!MatValid(mat)) return 1;
258 }
C4Material * Map
Definition: C4Material.h:171
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool MatValid(int32_t mat)
Definition: C4Material.h:212
int32_t DigFree
Definition: C4Material.h:96

Here is the call graph for this function:

int32_t MatPlacement ( int32_t  mat)
inline

Definition at line 248 of file C4Material.h.

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

249 {
250  if (!MatValid(mat)) return 0;
252 }
C4Material * Map
Definition: C4Material.h:171
int32_t Placement
Definition: C4Material.h:114
C4MaterialMap MaterialMap
Definition: C4Material.cpp:970
bool MatValid(int32_t mat)
Definition: C4Material.h:212

Here is the call graph for this function:

BYTE MatTex2PixCol ( int32_t  tex)
inline

Definition at line 232 of file C4Material.h.

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

233 {
234  return BYTE(tex);
235 }
uint8_t BYTE

Here is the caller graph for this function:

bool MatVehicle ( int32_t  iMat)
inline

Definition at line 217 of file C4Material.h.

References MVehic.

Referenced by C4Landscape::RaiseTerrain().

218 {
219  return iMat == MVehic;
220 }
int32_t MVehic
Definition: C4Material.cpp:37

Here is the caller graph for this function:

Variable Documentation

BYTE MCHalfVehic
int32_t MEarth

Definition at line 37 of file C4Material.cpp.

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

int32_t MWater

Definition at line 37 of file C4Material.cpp.

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