mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 16:09:06 +07:00
sample asset folder restructurization
This commit is contained in:
@@ -36,4 +36,4 @@ add_e2d_sample(02)
|
||||
add_e2d_sample(03)
|
||||
add_e2d_sample(04)
|
||||
add_e2d_sample(05)
|
||||
add_e2d_sample(07)
|
||||
add_e2d_sample(06)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:710b5d8aa292bf75c778d960a63f3b63857d2a7ab15541020cadf5bc5239656a
|
||||
size 890
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:75e1d17fb84154f882a20d5e5069ab52d6d635ba7a9691e78b4f93c8128be35a
|
||||
size 342389
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "font_bm_shader.json",
|
||||
"shader" : "../shaders/font_bm_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "font_sdf_shader.json",
|
||||
"shader" : "../shaders/font_sdf_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "spine_shader.json",
|
||||
"shader" : "../shaders/spine_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "spine_shader.json",
|
||||
"shader" : "../shaders/spine_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "dst_color",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "spine_shader.json",
|
||||
"shader" : "../shaders/spine_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "spine_shader.json",
|
||||
"shader" : "../shaders/spine_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "sprite_shader.json",
|
||||
"shader" : "../shaders/sprite_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "sprite_shader.json",
|
||||
"shader" : "../shaders/sprite_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "dst_color",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "sprite_shader.json",
|
||||
"shader" : "../shaders/sprite_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "sprite_shader.json",
|
||||
"shader" : "../shaders/sprite_shader.json",
|
||||
"state_block" : {
|
||||
"blending_state" : {
|
||||
"src_factor" : "one",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"passes" : [{
|
||||
"shader" : "model_shader.json",
|
||||
"shader" : "../../shaders/model_shader.json",
|
||||
"state_block" : {
|
||||
"capabilities_state" : {
|
||||
"depth_test" : true
|
||||
@@ -2,7 +2,7 @@
|
||||
"prototype" : "spine_prefab.json",
|
||||
"components" : {
|
||||
"spine_player" : {
|
||||
"model" : "spine_coin.json"
|
||||
"model" : "../spines/coin_spine.json"
|
||||
},
|
||||
"spine_player_cmd" : {
|
||||
"commands" : [{
|
||||
18
samples/bin/library/prefabs/dragon_prefab.json
Normal file
18
samples/bin/library/prefabs/dragon_prefab.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"prototype" : "spine_prefab.json",
|
||||
"components" : {
|
||||
"spine_player" : {
|
||||
"model" : "../spines/dragon_spine.json"
|
||||
},
|
||||
"spine_player_cmd" : {
|
||||
"commands" : [{
|
||||
"type" : "set_anim_cmd",
|
||||
"desc" : {
|
||||
"track" : 0,
|
||||
"name" : "flying",
|
||||
"loop" : true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
"components" : {
|
||||
"renderer" : {
|
||||
"materials" : [
|
||||
"gnome_material.json"
|
||||
"../models/gnome/gnome_material.json"
|
||||
]
|
||||
},
|
||||
"model_renderer" : {
|
||||
"model" : "gnome_model.json"
|
||||
"model" : "../models/gnome/gnome_model.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
"components" : {
|
||||
"renderer" : {
|
||||
"materials" : [
|
||||
"font_bm_material.json"
|
||||
"../materials/font_bm_material.json"
|
||||
]
|
||||
},
|
||||
"model_renderer" : {},
|
||||
"label" : {
|
||||
"font" : "arial_bm.fnt",
|
||||
"font" : "../fonts/arial_bm.fnt",
|
||||
"text" : "Hello World!"
|
||||
},
|
||||
"label.dirty" : {}
|
||||
@@ -2,12 +2,12 @@
|
||||
"components" : {
|
||||
"renderer" : {
|
||||
"materials" : [
|
||||
"font_sdf_material.json"
|
||||
"../materials/font_sdf_material.json"
|
||||
]
|
||||
},
|
||||
"model_renderer" : {},
|
||||
"label" : {
|
||||
"font" : "arial_sdf.fnt",
|
||||
"font" : "../fonts/arial_sdf.fnt",
|
||||
"text" : "Hello World!"
|
||||
},
|
||||
"label.dirty" : {}
|
||||
@@ -2,7 +2,7 @@
|
||||
"prototype" : "spine_prefab.json",
|
||||
"components" : {
|
||||
"spine_player" : {
|
||||
"model" : "spine_raptor.json"
|
||||
"model" : "../spines/raptor_spine.json"
|
||||
},
|
||||
"spine_player_cmd" : {
|
||||
"commands" : [{
|
||||
@@ -2,7 +2,7 @@
|
||||
"prototype" : "sprite_prefab.json",
|
||||
"components" : {
|
||||
"sprite_renderer" : {
|
||||
"sprite" : "ship_sprite.json"
|
||||
"sprite" : "../sprites/ship_sprite.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
15
samples/bin/library/prefabs/spine_prefab.json
Normal file
15
samples/bin/library/prefabs/spine_prefab.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"components" : {
|
||||
"renderer" : {},
|
||||
"spine_player" : {
|
||||
"materials" : {
|
||||
"additive" : "../materials/spine_material_additive.json",
|
||||
"multiply" : "../materials/spine_material_multiply.json",
|
||||
"normal" : "../materials/spine_material_normal.json",
|
||||
"screen" : "../materials/spine_material_screen.json"
|
||||
}
|
||||
},
|
||||
"spine_player_cmd" : {},
|
||||
"spine_player_evt" : {}
|
||||
}
|
||||
}
|
||||
13
samples/bin/library/prefabs/sprite_prefab.json
Normal file
13
samples/bin/library/prefabs/sprite_prefab.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"components" : {
|
||||
"renderer" : {},
|
||||
"sprite_renderer" : {
|
||||
"materials" : {
|
||||
"additive" : "../materials/sprite_material_additive.json",
|
||||
"multiply" : "../materials/sprite_material_multiply.json",
|
||||
"normal" : "../materials/sprite_material_normal.json",
|
||||
"screen" : "../materials/sprite_material_screen.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"components" : {
|
||||
"scene" : {}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "camera_prefab.json"
|
||||
},{
|
||||
"prototype" : "spine_coin_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [200,180,0],
|
||||
"scale" : 0.25
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "spine_raptor_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [-80,-100,0],
|
||||
"scale" : 0.25
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
@@ -3,9 +3,9 @@
|
||||
"scene" : {}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "camera_prefab.json"
|
||||
"prototype" : "../prefabs/camera_prefab.json"
|
||||
},{
|
||||
"prototype" : "gnome_prefab.json",
|
||||
"prototype" : "../prefabs/gnome_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [0,0,0],
|
||||
@@ -13,7 +13,7 @@
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "ship_prefab.json",
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
"components" : {
|
||||
"sprite_renderer" : {
|
||||
"blending" : "additive"
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "ship_prefab.json",
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
"components" : {
|
||||
"sprite_renderer" : {
|
||||
"tint" : [255,0,0,255]
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "label_bm_prefab.json",
|
||||
"prototype" : "../prefabs/label_bm_prefab.json",
|
||||
"components" : {
|
||||
"label" : {
|
||||
"text" : "bm font",
|
||||
@@ -47,7 +47,7 @@
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "label_sdf_prefab.json",
|
||||
"prototype" : "../prefabs/label_sdf_prefab.json",
|
||||
"components" : {
|
||||
"label" : {
|
||||
"text" : "sdf font",
|
||||
32
samples/bin/library/scenes/spine_scene_prefab.json
Normal file
32
samples/bin/library/scenes/spine_scene_prefab.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"components" : {
|
||||
"scene" : {}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/camera_prefab.json"
|
||||
},{
|
||||
"prototype" : "../prefabs/coin_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [350,250,0],
|
||||
"scale" : 0.25
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "../prefabs/raptor_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [300,-350,0],
|
||||
"scale" : 0.25
|
||||
}
|
||||
}
|
||||
}, {
|
||||
"prototype" : "../prefabs/dragon_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [-100,0,0],
|
||||
"scale" : 0.9
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:65cbe87077ff41bd595d1e17d68240e3e18972ea0c018707d35c695d86389b0d
|
||||
size 3513
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"components" : {
|
||||
"renderer" : {},
|
||||
"spine_player" : {
|
||||
"materials" : {
|
||||
"additive" : "spine_material_additive.json",
|
||||
"multiply" : "spine_material_multiply.json",
|
||||
"normal" : "spine_material_normal.json",
|
||||
"screen" : "spine_material_screen.json"
|
||||
}
|
||||
},
|
||||
"spine_player_cmd" : {},
|
||||
"spine_player_evt" : {}
|
||||
}
|
||||
}
|
||||
3
samples/bin/library/spines/coin/coin.atlas
Normal file
3
samples/bin/library/spines/coin/coin.atlas
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:833bc92c2a02695c326080b72f8636206ec53f361010a6b02324565b470f690b
|
||||
size 831
|
||||
3
samples/bin/library/spines/coin/coin.png
Normal file
3
samples/bin/library/spines/coin/coin.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:21bc65e3de306d698df5c6a6519786a430d8529bc58f01f87013c9927819f87a
|
||||
size 402363
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"atlas" : "coin/coin-pma.atlas",
|
||||
"atlas" : "coin/coin.atlas",
|
||||
"skeleton" : "coin/coin-pro.skel",
|
||||
"skeleton_scale" : 1.0
|
||||
}
|
||||
3
samples/bin/library/spines/dragon/dragon-ess.skel
Normal file
3
samples/bin/library/spines/dragon/dragon-ess.skel
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2d299087ede92db92396af117f151e8f50abecb57094f34b031d0a389a53d1ad
|
||||
size 7073
|
||||
3
samples/bin/library/spines/dragon/dragon.atlas
Normal file
3
samples/bin/library/spines/dragon/dragon.atlas
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fa3a79e67d926b1e5f017ecd2f2bc2f73fa02a766f27cc83a6547f0c90556c58
|
||||
size 4224
|
||||
3
samples/bin/library/spines/dragon/dragon.png
Normal file
3
samples/bin/library/spines/dragon/dragon.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a45ac203747ffc4802c83860b20bcb380b405ea55734992defb5fb64f49bbfa0
|
||||
size 628537
|
||||
3
samples/bin/library/spines/dragon/dragon2.png
Normal file
3
samples/bin/library/spines/dragon/dragon2.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:86b1a3fcd15a538e08535f0fad4b6cc1c9595060aae0d558c0f2bcc1d09a2833
|
||||
size 194829
|
||||
5
samples/bin/library/spines/dragon_spine.json
Normal file
5
samples/bin/library/spines/dragon_spine.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"atlas" : "dragon/dragon.atlas",
|
||||
"skeleton" : "dragon/dragon-ess.skel",
|
||||
"skeleton_scale" : 1.0
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"components" : {
|
||||
"renderer" : {},
|
||||
"sprite_renderer" : {
|
||||
"materials" : {
|
||||
"additive" : "sprite_material_additive.json",
|
||||
"multiply" : "sprite_material_multiply.json",
|
||||
"normal" : "sprite_material_normal.json",
|
||||
"screen" : "sprite_material_screen.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,11 +72,11 @@ namespace
|
||||
}
|
||||
private:
|
||||
bool create_scene() {
|
||||
auto model_res = the<library>().load_asset<model_asset>("gnome_model.json");
|
||||
auto model_mat = the<library>().load_asset<material_asset>("gnome_material.json");
|
||||
auto sprite_res = the<library>().load_asset<sprite_asset>("ship_sprite.json");
|
||||
auto sprite_mat = the<library>().load_asset<material_asset>("sprite_material.json");
|
||||
auto flipbook_res = the<library>().load_asset<flipbook_asset>("cube_flipbook.json");
|
||||
auto model_res = the<library>().load_asset<model_asset>("models/gnome/gnome_model.json");
|
||||
auto model_mat = the<library>().load_asset<material_asset>("models/gnome/gnome_material.json");
|
||||
auto sprite_res = the<library>().load_asset<sprite_asset>("sprites/ship_sprite.json");
|
||||
auto sprite_mat = the<library>().load_asset<material_asset>("materials/sprite_material_normal.json");
|
||||
auto flipbook_res = the<library>().load_asset<flipbook_asset>("sprites/cube_flipbook.json");
|
||||
|
||||
if ( !model_res || !model_mat || !sprite_res || !sprite_mat || !flipbook_res ) {
|
||||
return false;
|
||||
@@ -111,9 +111,9 @@ namespace
|
||||
sprite_i->entity_filler()
|
||||
.component<rotator>(rotator{v3f::unit_z()})
|
||||
.component<actor>(node::create(sprite_i, scene_r))
|
||||
.component<renderer>(renderer()
|
||||
.materials({sprite_mat}))
|
||||
.component<sprite_renderer>(sprite_res);
|
||||
.component<renderer>()
|
||||
.component<sprite_renderer>(sprite_renderer(sprite_res)
|
||||
.materials({{"normal", sprite_mat}}));
|
||||
|
||||
node_iptr sprite_n = sprite_i->get_component<actor>().get().node();
|
||||
sprite_n->translation(v3f{0,-50.f,0});
|
||||
@@ -126,10 +126,10 @@ namespace
|
||||
|
||||
flipbook_i->entity_filler()
|
||||
.component<actor>(node::create(flipbook_i, scene_r))
|
||||
.component<renderer>(renderer()
|
||||
.materials({sprite_mat}))
|
||||
.component<renderer>()
|
||||
.component<sprite_renderer>(sprite_renderer()
|
||||
.filtering(false))
|
||||
.filtering(false)
|
||||
.materials({{"normal", sprite_mat}}))
|
||||
.component<flipbook_source>(flipbook_res)
|
||||
.component<flipbook_player>(flipbook_player()
|
||||
.play("idle")
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace
|
||||
}
|
||||
private:
|
||||
bool create_scene() {
|
||||
auto scene_prefab_res = the<library>().load_asset<prefab_asset>("scene_prefab.json");
|
||||
auto scene_prefab_res = the<library>().load_asset<prefab_asset>("scenes/scene_prefab.json");
|
||||
auto scene_go = scene_prefab_res
|
||||
? the<world>().instantiate(scene_prefab_res->content())
|
||||
: nullptr;
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace
|
||||
}
|
||||
private:
|
||||
bool create_scene() {
|
||||
auto scene_prefab_res = the<library>().load_asset<prefab_asset>("scene_spine_prefab.json");
|
||||
auto scene_prefab_res = the<library>().load_asset<prefab_asset>("scenes/spine_scene_prefab.json");
|
||||
auto scene_go = scene_prefab_res
|
||||
? the<world>().instantiate(scene_prefab_res->content())
|
||||
: nullptr;
|
||||
@@ -109,7 +109,9 @@ namespace
|
||||
|
||||
int e2d_main(int argc, char *argv[]) {
|
||||
const auto starter_params = starter::parameters(
|
||||
engine::parameters("sample_07", "enduro2d")
|
||||
engine::parameters("sample_06", "enduro2d")
|
||||
.window_params(engine::window_parameters()
|
||||
.size({1024, 768}))
|
||||
.timer_params(engine::timer_parameters()
|
||||
.maximal_framerate(100)));
|
||||
modules::initialize<starter>(argc, argv, starter_params).start<game>();
|
||||
Reference in New Issue
Block a user