mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
More block particles, changes ore vein colour
This commit is contained in:
parent
bbcd842208
commit
8b8adcc1b8
@ -65,7 +65,7 @@
|
|||||||
dirt: (69, 48, 15),
|
dirt: (69, 48, 15),
|
||||||
scaffold: (195, 190, 212),
|
scaffold: (195, 190, 212),
|
||||||
lava: (184, 39, 0),
|
lava: (184, 39, 0),
|
||||||
vein: (222, 140, 39),
|
vein: (61, 229, 198),
|
||||||
),
|
),
|
||||||
site: (
|
site: (
|
||||||
castle: (),
|
castle: (),
|
||||||
|
@ -604,6 +604,11 @@ impl<const AVERAGE_PALETTE: bool> VoxelImageDecoding for TriPngEncoding<AVERAGE_
|
|||||||
g: 132,
|
g: 132,
|
||||||
b: 145,
|
b: 145,
|
||||||
},
|
},
|
||||||
|
GlowingRock => Rgb {
|
||||||
|
r: 61,
|
||||||
|
g: 229,
|
||||||
|
b: 198,
|
||||||
|
},
|
||||||
Grass => Rgb {
|
Grass => Rgb {
|
||||||
r: 51,
|
r: 51,
|
||||||
g: 160,
|
g: 160,
|
||||||
|
@ -36,7 +36,7 @@ make_case_elim!(
|
|||||||
// being *very* fast).
|
// being *very* fast).
|
||||||
Rock = 0x10,
|
Rock = 0x10,
|
||||||
WeakRock = 0x11, // Explodable
|
WeakRock = 0x11, // Explodable
|
||||||
Lava = 0x12,
|
Lava = 0x12, // TODO: Reevaluate whether this should be in the rock section
|
||||||
GlowingRock = 0x13,
|
GlowingRock = 0x13,
|
||||||
// 0x12 <= x < 0x20 is reserved for future rocks
|
// 0x12 <= x < 0x20 is reserved for future rocks
|
||||||
Grass = 0x20, // Note: *not* the same as grass sprites
|
Grass = 0x20, // Note: *not* the same as grass sprites
|
||||||
@ -166,38 +166,40 @@ impl Block {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_glow(&self) -> Option<u8> {
|
pub fn get_glow(&self) -> Option<u8> {
|
||||||
if matches!(self.kind, BlockKind::Lava | BlockKind::GlowingRock) {
|
match self.kind() {
|
||||||
return Some(24);
|
BlockKind::Lava => Some(24),
|
||||||
}
|
BlockKind::GlowingRock => Some(12),
|
||||||
match self.get_sprite()? {
|
_ => match self.get_sprite()? {
|
||||||
SpriteKind::StreetLamp | SpriteKind::StreetLampTall => Some(24),
|
SpriteKind::StreetLamp | SpriteKind::StreetLampTall => Some(24),
|
||||||
SpriteKind::Ember => Some(20),
|
SpriteKind::Ember => Some(20),
|
||||||
SpriteKind::WallLamp
|
SpriteKind::WallLamp
|
||||||
| SpriteKind::WallLampSmall
|
| SpriteKind::WallLampSmall
|
||||||
| SpriteKind::WallSconce
|
| SpriteKind::WallSconce
|
||||||
| SpriteKind::FireBowlGround
|
| SpriteKind::FireBowlGround
|
||||||
| SpriteKind::Orb => Some(16),
|
| SpriteKind::Orb => Some(16),
|
||||||
SpriteKind::Velorite | SpriteKind::VeloriteFrag | SpriteKind::CeilingMushroom => {
|
SpriteKind::Velorite
|
||||||
Some(6)
|
| SpriteKind::VeloriteFrag
|
||||||
|
| SpriteKind::Cauldron
|
||||||
|
| SpriteKind::CeilingMushroom => Some(6),
|
||||||
|
SpriteKind::CaveMushroom
|
||||||
|
| SpriteKind::CookingPot
|
||||||
|
| SpriteKind::CrystalHigh
|
||||||
|
| SpriteKind::CrystalLow => Some(10),
|
||||||
|
SpriteKind::Amethyst
|
||||||
|
| SpriteKind::Ruby
|
||||||
|
| SpriteKind::Sapphire
|
||||||
|
| SpriteKind::Diamond
|
||||||
|
| SpriteKind::Emerald
|
||||||
|
| SpriteKind::Topaz
|
||||||
|
| SpriteKind::AmethystSmall
|
||||||
|
| SpriteKind::TopazSmall
|
||||||
|
| SpriteKind::DiamondSmall
|
||||||
|
| SpriteKind::RubySmall
|
||||||
|
| SpriteKind::EmeraldSmall
|
||||||
|
| SpriteKind::SapphireSmall => Some(3),
|
||||||
|
SpriteKind::Lantern => Some(24),
|
||||||
|
_ => None,
|
||||||
},
|
},
|
||||||
SpriteKind::CaveMushroom
|
|
||||||
| SpriteKind::CookingPot
|
|
||||||
| SpriteKind::CrystalHigh
|
|
||||||
| SpriteKind::CrystalLow => Some(10),
|
|
||||||
SpriteKind::Amethyst
|
|
||||||
| SpriteKind::Ruby
|
|
||||||
| SpriteKind::Sapphire
|
|
||||||
| SpriteKind::Diamond
|
|
||||||
| SpriteKind::Emerald
|
|
||||||
| SpriteKind::Topaz
|
|
||||||
| SpriteKind::AmethystSmall
|
|
||||||
| SpriteKind::TopazSmall
|
|
||||||
| SpriteKind::DiamondSmall
|
|
||||||
| SpriteKind::RubySmall
|
|
||||||
| SpriteKind::EmeraldSmall
|
|
||||||
| SpriteKind::SapphireSmall => Some(3),
|
|
||||||
SpriteKind::Lantern => Some(24),
|
|
||||||
_ => None,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::clone_on_copy)] // TODO: fix after wgpu branch
|
#![allow(clippy::clone_on_copy)] // TODO: fix after wgpu branch
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
mesh::{
|
mesh::{
|
||||||
@ -461,11 +461,12 @@ fn should_draw_greedy(
|
|||||||
) -> Option<(bool, FaceKind)> {
|
) -> Option<(bool, FaceKind)> {
|
||||||
let from = flat_get(pos - delta);
|
let from = flat_get(pos - delta);
|
||||||
let to = flat_get(pos);
|
let to = flat_get(pos);
|
||||||
let from_opaque = from.is_opaque();
|
// Don't use `is_opaque`, because it actually refers to light transmission
|
||||||
if from_opaque == to.is_opaque() {
|
let from_filled = from.is_filled();
|
||||||
|
if from_filled == to.is_filled() {
|
||||||
// Check the interface of liquid and non-tangible non-liquid (e.g. air).
|
// Check the interface of liquid and non-tangible non-liquid (e.g. air).
|
||||||
let from_liquid = from.is_liquid();
|
let from_liquid = from.is_liquid();
|
||||||
if from_liquid == to.is_liquid() || from.is_opaque() || to.is_opaque() {
|
if from_liquid == to.is_liquid() || from.is_filled() || to.is_filled() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
// While liquid is not culled, we still try to keep a consistent orientation as
|
// While liquid is not culled, we still try to keep a consistent orientation as
|
||||||
@ -474,11 +475,11 @@ fn should_draw_greedy(
|
|||||||
Some((from_liquid, FaceKind::Fluid))
|
Some((from_liquid, FaceKind::Fluid))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// If going from transparent to opaque, backward facing; otherwise, forward
|
// If going from unfilled to filled, backward facing; otherwise, forward
|
||||||
// facing. Also, if either from or to is fluid, set the meta accordingly.
|
// facing. Also, if either from or to is fluid, set the meta accordingly.
|
||||||
Some((
|
Some((
|
||||||
from_opaque,
|
from_filled,
|
||||||
FaceKind::Opaque(if from_opaque {
|
FaceKind::Opaque(if from_filled {
|
||||||
to.is_liquid()
|
to.is_liquid()
|
||||||
} else {
|
} else {
|
||||||
from.is_liquid()
|
from.is_liquid()
|
||||||
|
@ -89,6 +89,9 @@ impl BlocksOfInterest {
|
|||||||
{
|
{
|
||||||
river.push(pos)
|
river.push(pos)
|
||||||
},
|
},
|
||||||
|
BlockKind::Lava if thread_rng().gen_range(0..5) == 0 => {
|
||||||
|
fires.push(pos + Vec3::unit_z())
|
||||||
|
},
|
||||||
BlockKind::Snow if thread_rng().gen_range(0..16) == 0 => snow.push(pos),
|
BlockKind::Snow if thread_rng().gen_range(0..16) == 0 => snow.push(pos),
|
||||||
_ => match block.get_sprite() {
|
_ => match block.get_sprite() {
|
||||||
Some(SpriteKind::Ember) => {
|
Some(SpriteKind::Ember) => {
|
||||||
@ -100,7 +103,7 @@ impl BlocksOfInterest {
|
|||||||
Some(SpriteKind::StreetLamp) => fire_bowls.push(pos + Vec3::unit_z() * 2),
|
Some(SpriteKind::StreetLamp) => fire_bowls.push(pos + Vec3::unit_z() * 2),
|
||||||
Some(SpriteKind::FireBowlGround) => fire_bowls.push(pos + Vec3::unit_z()),
|
Some(SpriteKind::FireBowlGround) => fire_bowls.push(pos + Vec3::unit_z()),
|
||||||
Some(SpriteKind::StreetLampTall) => {
|
Some(SpriteKind::StreetLampTall) => {
|
||||||
fire_bowls.push(pos + Vec3::unit_z() * 4)
|
fire_bowls.push(pos + Vec3::unit_z() * 3);
|
||||||
},
|
},
|
||||||
Some(SpriteKind::WallSconce) => fire_bowls.push(pos + Vec3::unit_z()),
|
Some(SpriteKind::WallSconce) => fire_bowls.push(pos + Vec3::unit_z()),
|
||||||
Some(SpriteKind::Beehive) => beehives.push(pos),
|
Some(SpriteKind::Beehive) => beehives.push(pos),
|
||||||
@ -134,12 +137,14 @@ impl BlocksOfInterest {
|
|||||||
interactables.push((pos, Interaction::Craft(CraftingTab::All)))
|
interactables.push((pos, Interaction::Craft(CraftingTab::All)))
|
||||||
},
|
},
|
||||||
Some(SpriteKind::Cauldron) => {
|
Some(SpriteKind::Cauldron) => {
|
||||||
|
fires.push(pos);
|
||||||
interactables.push((pos, Interaction::Craft(CraftingTab::Potion)))
|
interactables.push((pos, Interaction::Craft(CraftingTab::Potion)))
|
||||||
},
|
},
|
||||||
Some(SpriteKind::Anvil) => {
|
Some(SpriteKind::Anvil) => {
|
||||||
interactables.push((pos, Interaction::Craft(CraftingTab::Weapon)))
|
interactables.push((pos, Interaction::Craft(CraftingTab::Weapon)))
|
||||||
},
|
},
|
||||||
Some(SpriteKind::CookingPot) => {
|
Some(SpriteKind::CookingPot) => {
|
||||||
|
fires.push(pos);
|
||||||
interactables.push((pos, Interaction::Craft(CraftingTab::Food)))
|
interactables.push((pos, Interaction::Craft(CraftingTab::Food)))
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
|
@ -253,7 +253,7 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) {
|
|||||||
canvas.set(
|
canvas.set(
|
||||||
Vec3::new(wpos2d.x, wpos2d.y, z),
|
Vec3::new(wpos2d.x, wpos2d.y, z),
|
||||||
Block::new(
|
Block::new(
|
||||||
BlockKind::WeakRock,
|
BlockKind::GlowingRock,
|
||||||
noisy_color(info.index().colors.layer.vein.into(), 16),
|
noisy_color(info.index().colors.layer.vein.into(), 16),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -265,7 +265,7 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) {
|
|||||||
canvas.set(
|
canvas.set(
|
||||||
Vec3::new(wpos2d.x, wpos2d.y, z),
|
Vec3::new(wpos2d.x, wpos2d.y, z),
|
||||||
Block::new(
|
Block::new(
|
||||||
BlockKind::WeakRock,
|
BlockKind::GlowingRock,
|
||||||
noisy_color(info.index().colors.layer.vein.into(), 16),
|
noisy_color(info.index().colors.layer.vein.into(), 16),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user