fixed component loading

This commit is contained in:
andrey.zhirnov
2019-08-26 18:33:35 +03:00
parent ca9f57f7d4
commit a53060f423
2 changed files with 7 additions and 16 deletions

View File

@@ -120,14 +120,10 @@ namespace e2d
"model" : { "$ref": "#/common_definitions/address" }, "model" : { "$ref": "#/common_definitions/address" },
"animations" : { "animations" : {
"type" : "array", "type" : "array",
"items" : { "$ref": "#/definitions/spine_animation_array" } "items" : { "$ref": "#/definitions/spine_animation" }
} }
}, },
"definitions" : { "definitions" : {
"spine_animation_array" : {
"type" : "array",
"items" : { "$ref": "#/definitions/spine_animation" }
},
"spine_animation" : { "spine_animation" : {
"type" : "object", "type" : "object",
"required" : [ "track", "name" ], "required" : [ "track", "name" ],
@@ -151,8 +147,8 @@ namespace e2d
path::combine(ctx.parent_address, ctx.root["model"].GetString())); path::combine(ctx.parent_address, ctx.root["model"].GetString()));
if ( !model ) { if ( !model ) {
the<debug>().error("SPINE_PLAYER: Dependency 'model' is not found:\n" the<debug>().error("SPINE_PLAYER: Dependency 'model' is not found:\n"
"--> Parent address: %s\n" "--> Parent address: %0\n"
"--> Dependency address: $s", "--> Dependency address: %1",
ctx.parent_address, ctx.parent_address,
ctx.root["model"].GetString()); ctx.root["model"].GetString());
return false; return false;

View File

@@ -97,8 +97,8 @@ namespace e2d
path::combine(ctx.parent_address, ctx.root["model"].GetString())); path::combine(ctx.parent_address, ctx.root["model"].GetString()));
if ( !model ) { if ( !model ) {
the<debug>().error("SPINE RENDERER: Dependency 'model' is not found:\n" the<debug>().error("SPINE RENDERER: Dependency 'model' is not found:\n"
"--> Parent address: %s\n" "--> Parent address: %0\n"
"--> Dependency address: $s", "--> Dependency address: %1",
ctx.parent_address, ctx.parent_address,
ctx.root["model"].GetString()); ctx.root["model"].GetString());
return false; return false;
@@ -115,7 +115,7 @@ namespace e2d
component.skin(skin); component.skin(skin);
} }
return false; return true;
} }
bool factory_loader<spine_renderer>::operator()( bool factory_loader<spine_renderer>::operator()(
@@ -126,12 +126,7 @@ namespace e2d
dependencies.add_dependency<spine_model_asset>( dependencies.add_dependency<spine_model_asset>(
path::combine(ctx.parent_address, ctx.root["model"].GetString())); path::combine(ctx.parent_address, ctx.root["model"].GetString()));
} }
if ( ctx.root.HasMember("skin") ) {
dependencies.add_dependency<spine_model_asset>(
path::combine(ctx.parent_address, ctx.root["skin"].GetString()));
}
return false; return true;
} }
} }