mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
sitä sun tätä tekeillä, toimii kivasti
This commit is contained in:
parent
e8fd5eb8ee
commit
c707e00195
19 changed files with 998 additions and 761 deletions
|
@ -17,10 +17,25 @@
|
|||
|
||||
#define MATERIALS_COUNT 256
|
||||
|
||||
// This is completely ignored. It doesn't create faces with anything.
|
||||
/*
|
||||
Ignored node.
|
||||
|
||||
param is used for custom information in special containers,
|
||||
like VoxelManipulator.
|
||||
|
||||
Anything that stores MapNodes doesn't have to preserve parameters
|
||||
associated with this material.
|
||||
|
||||
Doesn't create faces with anything and is considered being
|
||||
out-of-map in the game map.
|
||||
*/
|
||||
#define MATERIAL_IGNORE 255
|
||||
// This is the common material through which the player can walk
|
||||
// and which is transparent to light
|
||||
#define MATERIAL_IGNORE_DEFAULT_PARAM 0
|
||||
|
||||
/*
|
||||
The common material through which the player can walk and which
|
||||
is transparent to light
|
||||
*/
|
||||
#define MATERIAL_AIR 254
|
||||
|
||||
/*
|
||||
|
@ -63,6 +78,8 @@ enum Material
|
|||
MATERIAL_GRASS_FOOTSTEPS,
|
||||
|
||||
MATERIAL_MESE,
|
||||
|
||||
MATERIAL_MUD,
|
||||
|
||||
// This is set to the number of the actual values in this enum
|
||||
USEFUL_MATERIAL_COUNT
|
||||
|
@ -126,6 +143,21 @@ inline u8 face_materials(u8 m1, u8 m2)
|
|||
return 2;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns true for materials that form the base ground that
|
||||
follows the main heightmap
|
||||
*/
|
||||
inline bool is_ground_material(u8 m)
|
||||
{
|
||||
return(
|
||||
m == MATERIAL_STONE ||
|
||||
m == MATERIAL_GRASS ||
|
||||
m == MATERIAL_GRASS_FOOTSTEPS ||
|
||||
m == MATERIAL_MESE ||
|
||||
m == MATERIAL_MUD
|
||||
);
|
||||
}
|
||||
|
||||
struct MapNode
|
||||
{
|
||||
//TODO: block type to differ from material
|
||||
|
@ -133,9 +165,6 @@ struct MapNode
|
|||
// block type
|
||||
u8 d;
|
||||
|
||||
// Removed because light is now stored in param for air
|
||||
// f32 light;
|
||||
|
||||
/*
|
||||
Misc parameter. Initialized to 0.
|
||||
- For light_propagates() blocks, this is light intensity,
|
||||
|
@ -155,6 +184,11 @@ struct MapNode
|
|||
param = a_param;
|
||||
}
|
||||
|
||||
bool operator==(const MapNode &other)
|
||||
{
|
||||
return (d == other.d && param == other.param);
|
||||
}
|
||||
|
||||
bool light_propagates()
|
||||
{
|
||||
return light_propagates_material(d);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue