mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
resource: change BlockColor into an array
This commit is contained in:
parent
fbf212b55f
commit
46802116d9
4 changed files with 942 additions and 942 deletions
|
@ -36,7 +36,7 @@ with open(sys.argv[2], 'w') as f:
|
||||||
flags.append('Water')
|
flags.append('Water')
|
||||||
flags = 'make_bitflags!(BlockFlag::{' + '|'.join(flags) + '})'
|
flags = 'make_bitflags!(BlockFlag::{' + '|'.join(flags) + '})'
|
||||||
|
|
||||||
print('\t("%s", BlockType { flags: %s, color: BlockColor(%u, %u, %u) }),' % (
|
print('\t("%s", BlockType { flags: %s, color: BlockColor([%u, %u, %u]) }),' % (
|
||||||
name,
|
name,
|
||||||
flags,
|
flags,
|
||||||
info['color']['r'],
|
info['color']['r'],
|
||||||
|
|
|
@ -289,8 +289,8 @@ impl<'a> TileRenderer<'a> {
|
||||||
z: BlockZ(z as u8),
|
z: BlockZ(z as u8),
|
||||||
}] {
|
}] {
|
||||||
Some(block) => {
|
Some(block) => {
|
||||||
let c = block.block_type.color;
|
let c = block.block_type.color.0;
|
||||||
[c.0, c.1, c.2, 255]
|
[c[0], c[1], c[2], 255]
|
||||||
}
|
}
|
||||||
None => [0, 0, 0, 0],
|
None => [0, 0, 0, 0],
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -34,7 +34,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
||||||
pub struct BlockColor(pub u8, pub u8, pub u8);
|
pub struct BlockColor(pub [u8; 3]);
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
||||||
pub struct BlockType {
|
pub struct BlockType {
|
||||||
|
|
Loading…
Add table
Reference in a new issue