mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
Minor refactor
This commit is contained in:
parent
5342d5489d
commit
85d85dada7
2 changed files with 6 additions and 16 deletions
|
|
@ -11,9 +11,9 @@ const int BLOCK_DIR_UP = 0x4;
|
|||
const int BLOCK_DIR_DOWN = 0x5;
|
||||
|
||||
// limited to 8 block orientations
|
||||
const int BLOCK_ROT_MASK = 0b0000'0111;
|
||||
// limited to 32 block variants
|
||||
const int BLOCK_VARIANT_MASK = 0b1111'1000;
|
||||
const int BLOCK_ROT_MASK = 0b0000'0111;
|
||||
// reserved bits
|
||||
const int BLOCK_RESERVED_MASK = 0b1111'1000;
|
||||
|
||||
struct voxel {
|
||||
blockid_t id;
|
||||
|
|
@ -22,10 +22,6 @@ struct voxel {
|
|||
inline uint8_t rotation() const {
|
||||
return states & BLOCK_ROT_MASK;
|
||||
}
|
||||
|
||||
inline uint8_t variant() const {
|
||||
return (states & BLOCK_VARIANT_MASK) >> 3;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* VOXELS_VOXEL_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue