mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
unify naming for built-in assets
This commit is contained in:
@@ -51,7 +51,7 @@ use gltf::texture::MinFilter as GltfMinFilter;
|
||||
|
||||
pub static GLTF_SHADER: LazyLock<BuiltInResource<Shader>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__GLTF_StandardShader",
|
||||
"GltfShader",
|
||||
embedded_data_source!("gltf_standard.shader"),
|
||||
|data| {
|
||||
ShaderResource::new_ok(
|
||||
|
||||
@@ -1470,7 +1470,7 @@ impl ResourceLoader for SurfaceDataLoader {
|
||||
/// Cube surface resource.
|
||||
pub static CUBE: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__CubeSurface",
|
||||
"Cube Surface",
|
||||
SurfaceResource::new_ok(
|
||||
uuid!("d3a4604a-e1c6-430b-b524-8d3213723952"),
|
||||
ResourceKind::External,
|
||||
@@ -1482,7 +1482,7 @@ pub static CUBE: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
/// Quad surface resource.
|
||||
pub static QUAD: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__QuadSurface",
|
||||
"Quad Surface",
|
||||
SurfaceResource::new_ok(
|
||||
uuid!("a124317f-640b-4c1b-9fdc-af62f745eeba"),
|
||||
ResourceKind::External,
|
||||
@@ -1494,7 +1494,7 @@ pub static QUAD: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
/// Cylinder surface resource.
|
||||
pub static CYLINDER: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__CylinderSurface",
|
||||
"Cylinder Surface",
|
||||
SurfaceResource::new_ok(
|
||||
uuid!("16300ec8-4446-41a7-8ad6-9b45428d0b1b"),
|
||||
ResourceKind::External,
|
||||
@@ -1506,7 +1506,7 @@ pub static CYLINDER: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
/// Sphere surface resource.
|
||||
pub static SPHERE: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__SphereSurface",
|
||||
"Sphere Surface",
|
||||
SurfaceResource::new_ok(
|
||||
uuid!("ff1811ba-b9ad-4c37-89b8-503f79aaa4bd"),
|
||||
ResourceKind::External,
|
||||
@@ -1518,7 +1518,7 @@ pub static SPHERE: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
/// Cone surface resource.
|
||||
pub static CONE: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__ConeSurface",
|
||||
"Cone Surface",
|
||||
SurfaceResource::new_ok(
|
||||
uuid!("e4e79405-39c5-4fe4-ba3e-c961f3d7379e"),
|
||||
ResourceKind::External,
|
||||
@@ -1530,7 +1530,7 @@ pub static CONE: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
/// Torus surface resource.
|
||||
pub static TORUS: LazyLock<BuiltInResource<SurfaceData>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__TorusSurface",
|
||||
"Torus Surface",
|
||||
SurfaceResource::new_ok(
|
||||
uuid!("d2bb5455-c72e-475d-90da-e3a7bd5b7d07"),
|
||||
ResourceKind::External,
|
||||
|
||||
@@ -509,7 +509,7 @@ fn load_texture(id: Uuid, data: &[u8]) -> TextureResource {
|
||||
|
||||
static BUILT_IN_SKYBOX_FRONT: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_SKYBOX_FRONT",
|
||||
"Skybox Front Face",
|
||||
embedded_data_source!("skybox/front.png"),
|
||||
|data| load_texture(uuid!("f8d4519b-2947-4c83-9aa5-800a70ae918e"), data),
|
||||
)
|
||||
@@ -517,7 +517,7 @@ static BUILT_IN_SKYBOX_FRONT: LazyLock<BuiltInResource<Texture>> = LazyLock::new
|
||||
|
||||
static BUILT_IN_SKYBOX_BACK: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_SKYBOX_BACK",
|
||||
"Skybox Back Face",
|
||||
embedded_data_source!("skybox/back.png"),
|
||||
|data| load_texture(uuid!("28676705-58bd-440f-b0aa-ce42cf95be79"), data),
|
||||
)
|
||||
@@ -525,7 +525,7 @@ static BUILT_IN_SKYBOX_BACK: LazyLock<BuiltInResource<Texture>> = LazyLock::new(
|
||||
|
||||
static BUILT_IN_SKYBOX_TOP: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_SKYBOX_TOP",
|
||||
"Skybox Top Face",
|
||||
embedded_data_source!("skybox/top.png"),
|
||||
|data| load_texture(uuid!("03e38da7-53d1-48c0-87f8-2baf9869d61d"), data),
|
||||
)
|
||||
@@ -533,7 +533,7 @@ static BUILT_IN_SKYBOX_TOP: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|
|
||||
|
||||
static BUILT_IN_SKYBOX_BOTTOM: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_SKYBOX_BOTTOM",
|
||||
"Skybox Bottom Face",
|
||||
embedded_data_source!("skybox/bottom.png"),
|
||||
|data| load_texture(uuid!("01684dc1-34b2-48b3-b8c2-30a7718cb9e7"), data),
|
||||
)
|
||||
@@ -541,7 +541,7 @@ static BUILT_IN_SKYBOX_BOTTOM: LazyLock<BuiltInResource<Texture>> = LazyLock::ne
|
||||
|
||||
static BUILT_IN_SKYBOX_LEFT: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_SKYBOX_LEFT",
|
||||
"Skybox Left Face",
|
||||
embedded_data_source!("skybox/left.png"),
|
||||
|data| load_texture(uuid!("1725b779-7633-477a-a7b0-995c079c3202"), data),
|
||||
)
|
||||
@@ -549,7 +549,7 @@ static BUILT_IN_SKYBOX_LEFT: LazyLock<BuiltInResource<Texture>> = LazyLock::new(
|
||||
|
||||
static BUILT_IN_SKYBOX_RIGHT: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_SKYBOX_RIGHT",
|
||||
"Skybox Right Face",
|
||||
embedded_data_source!("skybox/right.png"),
|
||||
|data| load_texture(uuid!("5f74865a-3eae-4bff-8743-b9d1f7bb3c59"), data),
|
||||
)
|
||||
|
||||
@@ -1087,7 +1087,7 @@ impl MaterialResourceExtension for MaterialResource {
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__StandardMaterial",
|
||||
"Default Material",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("fac37721-d1b8-422e-ae0c-83196ecd0a26"),
|
||||
ResourceKind::External,
|
||||
@@ -1100,7 +1100,7 @@ pub static STANDARD: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD_2D: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__Standard2DMaterial",
|
||||
"2D Material",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("fe78a0d0-d059-4156-bc63-c3d2e36ad4b6"),
|
||||
ResourceKind::External,
|
||||
@@ -1113,7 +1113,7 @@ pub static STANDARD_2D: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD_PARTICLE_SYSTEM: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__StandardParticleSystemMaterial",
|
||||
"Particle SystemMaterial",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("5bebe6e5-4aeb-496f-88f6-abe2b1ac798b"),
|
||||
ResourceKind::External,
|
||||
@@ -1126,7 +1126,7 @@ pub static STANDARD_PARTICLE_SYSTEM: LazyLock<BuiltInResource<Material>> = LazyL
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD_SPRITE: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__StandardSpriteMaterial",
|
||||
"Sprite Material",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("3e331786-baae-412b-9d99-7370174bca43"),
|
||||
ResourceKind::External,
|
||||
@@ -1139,7 +1139,7 @@ pub static STANDARD_SPRITE: LazyLock<BuiltInResource<Material>> = LazyLock::new(
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD_TERRAIN: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__StandardTerrainMaterial",
|
||||
"Terrain Material",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("0e407e22-41ad-4763-9adb-9d2e86351ece"),
|
||||
ResourceKind::External,
|
||||
@@ -1152,7 +1152,7 @@ pub static STANDARD_TERRAIN: LazyLock<BuiltInResource<Material>> = LazyLock::new
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD_TWOSIDES: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__StandardTwoSidesMaterial",
|
||||
"Two Sides Material",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("24115321-7766-495c-bc3a-75db2f73d26d"),
|
||||
ResourceKind::External,
|
||||
@@ -1165,7 +1165,7 @@ pub static STANDARD_TWOSIDES: LazyLock<BuiltInResource<Material>> = LazyLock::ne
|
||||
/// of it will reflect on every other usage of it.
|
||||
pub static STANDARD_WIDGET: LazyLock<BuiltInResource<Material>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__StandardWidgetMaterial",
|
||||
"Widget Material",
|
||||
MaterialResource::new_ok(
|
||||
uuid!("e5d61a6f-5c94-4137-b303-1ae29cfff6e7"),
|
||||
ResourceKind::External,
|
||||
|
||||
@@ -486,28 +486,28 @@ use uuid::uuid;
|
||||
pub mod loader;
|
||||
|
||||
/// A name of the standard shader.
|
||||
pub const STANDARD_SHADER_NAME: &str = "Standard";
|
||||
pub const STANDARD_SHADER_NAME: &str = "Default Shader";
|
||||
|
||||
/// A name of the standard 2D shader.
|
||||
pub const STANDARD_2D_SHADER_NAME: &str = "Standard2D";
|
||||
pub const STANDARD_2D_SHADER_NAME: &str = "2D Shader";
|
||||
|
||||
/// A name of the standard particle system shader.
|
||||
pub const STANDARD_PARTICLE_SYSTEM_SHADER_NAME: &str = "StandardParticleSystem";
|
||||
pub const STANDARD_PARTICLE_SYSTEM_SHADER_NAME: &str = "Particle System Shader";
|
||||
|
||||
/// A name of the standard two-sides shader.
|
||||
pub const STANDARD_TWOSIDES_SHADER_NAME: &str = "StandardTwoSides";
|
||||
pub const STANDARD_TWOSIDES_SHADER_NAME: &str = "Two Sides Shader";
|
||||
|
||||
/// A name of the standard terrain shader.
|
||||
pub const STANDARD_TERRAIN_SHADER_NAME: &str = "StandardTerrain";
|
||||
pub const STANDARD_TERRAIN_SHADER_NAME: &str = "Terrain Shader";
|
||||
|
||||
/// A name of the standard tile shader.
|
||||
pub const STANDARD_TILE_SHADER_NAME: &str = "StandardTile";
|
||||
pub const STANDARD_TILE_SHADER_NAME: &str = "Tile Shader";
|
||||
|
||||
/// A name of the standard sprite shader.
|
||||
pub const STANDARD_SPRITE_SHADER_NAME: &str = "StandardSprite";
|
||||
pub const STANDARD_SPRITE_SHADER_NAME: &str = "Sprite Shader";
|
||||
|
||||
/// A name of the standard widget shader.
|
||||
pub const STANDARD_WIDGET_SHADER_NAME: &str = "StandardWidget";
|
||||
pub const STANDARD_WIDGET_SHADER_NAME: &str = "Widget Shader";
|
||||
|
||||
/// Internal state of the shader.
|
||||
///
|
||||
|
||||
@@ -673,7 +673,7 @@ impl TextureImportOptions {
|
||||
/// Placeholder texture.
|
||||
pub static PLACEHOLDER: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__PlaceholderTexture",
|
||||
"Default Texture",
|
||||
embedded_data_source!("default.png"),
|
||||
|data| {
|
||||
TextureResource::load_from_memory(
|
||||
@@ -690,7 +690,7 @@ pub static PLACEHOLDER: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
/// Pure color texture.
|
||||
pub static PURE_COLOR: LazyLock<BuiltInResource<Texture>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__PureColorTexture",
|
||||
"Pure Color Texture",
|
||||
embedded_data_source!("pure_color.png"),
|
||||
|data| {
|
||||
TextureResource::load_from_memory(
|
||||
|
||||
@@ -415,7 +415,7 @@ pub type FontResource = Resource<Font>;
|
||||
/// Fyrox's default build-in font for rendering bold italic text when no other font is specified.
|
||||
pub static BOLD_ITALIC: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BOLD_ITALIC__",
|
||||
"Bold Italic Font",
|
||||
embedded_data_source!("./bold_italic.ttf"),
|
||||
|data| {
|
||||
FontResource::new_ok(
|
||||
@@ -431,7 +431,7 @@ pub static BOLD_ITALIC: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
/// Fyrox's default build-in font for rendering italic text when no other font is specified.
|
||||
pub static BUILT_IN_ITALIC: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_ITALIC__",
|
||||
"Italic Font",
|
||||
embedded_data_source!("./built_in_italic.ttf"),
|
||||
|data| {
|
||||
let bold = Some(BOLD_ITALIC.resource());
|
||||
@@ -451,7 +451,7 @@ pub static BUILT_IN_ITALIC: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
/// Fyrox's default build-in font for rendering bold text when no other font is specified.
|
||||
pub static BUILT_IN_BOLD: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_BOLD__",
|
||||
"Bold Font",
|
||||
embedded_data_source!("./built_in_bold.ttf"),
|
||||
|data| {
|
||||
let italic = Some(BOLD_ITALIC.resource());
|
||||
@@ -471,7 +471,7 @@ pub static BUILT_IN_BOLD: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
/// Fyrox's default build-in font for rendering text when no other font is specified.
|
||||
pub static BUILT_IN_FONT: LazyLock<BuiltInResource<Font>> = LazyLock::new(|| {
|
||||
BuiltInResource::new(
|
||||
"__BUILT_IN_FONT__",
|
||||
"Default Font",
|
||||
embedded_data_source!("./built_in_font.ttf"),
|
||||
|data| {
|
||||
let styles = FontStyles {
|
||||
|
||||
@@ -128,7 +128,7 @@ impl_casts!(TextureResource => Texture);
|
||||
/// Default style of the library.
|
||||
pub static DEFAULT_STYLE: LazyLock<BuiltInResource<Style>> = LazyLock::new(|| {
|
||||
BuiltInResource::new_no_source(
|
||||
"__DEFAULT_STYLE__",
|
||||
"Default Style",
|
||||
StyleResource::new_ok(
|
||||
uuid!("1e0716e8-e728-491c-a65b-ca11b15048be"),
|
||||
ResourceKind::External,
|
||||
|
||||
Reference in New Issue
Block a user