Merge branch 'sharp/sprite-config' into 'master'

Move sprite data to a config file.

See merge request veloren/veloren!1324
This commit is contained in:
Joshua Yanovski 2020-08-28 08:30:50 +00:00
commit e59395bfe0
6 changed files with 2196 additions and 2270 deletions

1
Cargo.lock generated
View File

@ -4800,6 +4800,7 @@ dependencies = [
"directories-next",
"dispatch 0.1.4",
"dot_vox",
"enum-iterator",
"euc",
"failure",
"gfx",

File diff suppressed because it is too large Load Diff

View File

@ -1,97 +1,100 @@
use crate::vol::Vox;
use crate::{make_case_elim, vol::Vox};
use enum_iterator::IntoEnumIterator;
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, convert::TryFrom, fmt, ops::Deref};
use vek::*;
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize, IntoEnumIterator)]
#[repr(u8)]
pub enum BlockKind {
Air,
Normal,
Dense,
Rock,
Grass,
Leaves,
Water,
LargeCactus,
BarrelCactus,
RoundCactus,
ShortCactus,
MedFlatCactus,
ShortFlatCactus,
BlueFlower,
PinkFlower,
PurpleFlower,
RedFlower,
WhiteFlower,
YellowFlower,
Sunflower,
LongGrass,
MediumGrass,
ShortGrass,
Apple,
Mushroom,
Liana,
Velorite,
VeloriteFrag,
Chest,
Pumpkin,
Welwitch,
LingonBerry,
LeafyPlant,
Fern,
DeadBush,
Blueberry,
Ember,
Corn,
WheatYellow,
WheatGreen,
Cabbage,
Flax,
Carrot,
Tomato,
Radish,
Coconut,
Turnip,
Window1,
Window2,
Window3,
Window4,
Scarecrow,
StreetLamp,
StreetLampTall,
Door,
Bed,
Bench,
ChairSingle,
ChairDouble,
CoatRack,
Crate,
DrawerLarge,
DrawerMedium,
DrawerSmall,
DungeonWallDecor,
HangingBasket,
HangingSign,
WallLamp,
Planter,
Shelf,
TableSide,
TableDining,
TableDouble,
WardrobeSingle,
WardrobeDouble,
LargeGrass,
Pot,
Stones,
Twigs,
ShinyGem,
DropGate,
DropGateBottom,
GrassSnow,
}
make_case_elim!(
block_kind,
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize, IntoEnumIterator)]
#[repr(u8)]
pub enum BlockKind {
Air = 0x00,
Normal = 0x01,
Dense = 0x02,
Rock = 0x03,
Grass = 0x04,
Leaves = 0x05,
Water = 0x06,
LargeCactus = 0x07,
BarrelCactus = 0x08,
RoundCactus = 0x09,
ShortCactus = 0x0A,
MedFlatCactus = 0x0B,
ShortFlatCactus = 0x0C,
BlueFlower = 0x0D,
PinkFlower = 0x0E,
PurpleFlower = 0x0F,
RedFlower = 0x10,
WhiteFlower = 0x11,
YellowFlower = 0x12,
Sunflower = 0x13,
LongGrass = 0x14,
MediumGrass = 0x15,
ShortGrass = 0x16,
Apple = 0x17,
Mushroom = 0x18,
Liana = 0x19,
Velorite = 0x1A,
VeloriteFrag = 0x1B,
Chest = 0x1C,
Pumpkin = 0x1D,
Welwitch = 0x1E,
LingonBerry = 0x1F,
LeafyPlant = 0x20,
Fern = 0x21,
DeadBush = 0x22,
Blueberry = 0x23,
Ember = 0x24,
Corn = 0x25,
WheatYellow = 0x26,
WheatGreen = 0x27,
Cabbage = 0x28,
Flax = 0x29,
Carrot = 0x2A,
Tomato = 0x2B,
Radish = 0x2C,
Coconut = 0x2D,
Turnip = 0x2E,
Window1 = 0x2F,
Window2 = 0x30,
Window3 = 0x31,
Window4 = 0x32,
Scarecrow = 0x33,
StreetLamp = 0x34,
StreetLampTall = 0x35,
Door = 0x36,
Bed = 0x37,
Bench = 0x38,
ChairSingle = 0x39,
ChairDouble = 0x3A,
CoatRack = 0x3B,
Crate = 0x3C,
DrawerLarge = 0x3D,
DrawerMedium = 0x3E,
DrawerSmall = 0x3F,
DungeonWallDecor = 0x40,
HangingBasket = 0x41,
HangingSign = 0x42,
WallLamp = 0x43,
Planter = 0x44,
Shelf = 0x45,
TableSide = 0x46,
TableDining = 0x47,
TableDouble = 0x48,
WardrobeSingle = 0x49,
WardrobeDouble = 0x4A,
LargeGrass = 0x4B,
Pot = 0x4C,
Stones = 0x4D,
Twigs = 0x4E,
ShinyGem = 0x4F,
DropGate = 0x50,
DropGateBottom = 0x51,
GrassSnow = 0x52,
}
);
impl fmt::Display for BlockKind {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{:?}", self) }

View File

@ -198,10 +198,10 @@ macro_rules! make_case_elim {
}
#[allow(unused_parens)]
impl<'a, Elim: $mod::PackedElim, Context, Type, S>
$crate::typed::Typed<Context, Type, S> for $crate::typed::ElimCase<&'a $ty, &'a $mod::Cases<Elim>, Type>
impl<'a, 'b, Elim: $mod::PackedElim, Context, Type, S>
$crate::typed::Typed<Context, Type, S> for $crate::typed::ElimCase<&'a $ty, &'b $mod::Cases<Elim>, Type>
where
$( &'a Elim::$constr: $crate::typed::Typed<($( ($( &'a $arg_ty, )*), )? Context), Type, S>, )*
$( &'b Elim::$constr: $crate::typed::Typed<($( ($( &'a $arg_ty, )*), )? Context), Type, S>, )*
{
fn reduce(self, context: Context) -> (Type, S)
{
@ -218,10 +218,10 @@ macro_rules! make_case_elim {
}
impl $ty {
pub fn elim_case<'a, Elim: $mod::PackedElim, Context, S, Type>(&'a self, cases: &'a $mod::Cases<Elim>, context: Context) ->
pub fn elim_case<'a, 'b, Elim: $mod::PackedElim, Context, S, Type>(&'a self, cases: &'b $mod::Cases<Elim>, context: Context) ->
(Type, S)
where
$crate::typed::ElimCase<&'a $ty, &'a $mod::Cases<Elim>, Type> : $crate::typed::Typed<Context, Type, S>,
$crate::typed::ElimCase<&'a $ty, &'b $mod::Cases<Elim>, Type> : $crate::typed::Typed<Context, Type, S>,
{
use $crate::typed::Typed;
@ -233,7 +233,7 @@ macro_rules! make_case_elim {
case.reduce(context)
}
pub fn elim_case_pure<'a, Type>(&'a self, cases: &'a $mod::PureCases<Type>) -> &'a Type
pub fn elim_case_pure<'a, 'b, Type>(&'a self, cases: &'b $mod::PureCases<Type>) -> &'b Type
{
let ($crate::typed::Pure(expr), ()) = self.elim_case(cases, ());
expr

View File

@ -50,6 +50,7 @@ server = { package = "veloren-server", path = "../server", optional = true }
glsl-include = "0.3.1"
failure = "0.1.6"
dot_vox = "4.0"
enum-iterator = "0.6"
image = { version = "0.23.8", default-features = false, features = ["ico", "png"] }
serde = "1.0"
serde_derive = "1.0"

File diff suppressed because it is too large Load Diff